[Python-checkins] python/nondist/sandbox/datetime obj_delta.c,1.4,1.5

tim_one@users.sourceforge.net tim_one@users.sourceforge.net
Mon, 25 Nov 2002 19:29:20 -0800


Update of /cvsroot/python/python/nondist/sandbox/datetime
In directory sc8-pr-cvs1:/tmp/cvs-serv21119

Modified Files:
	obj_delta.c 
Log Message:
delta_add():  Fiddled decls; XXX comments about useless code; this looks
unfinished.


Index: obj_delta.c
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/datetime/obj_delta.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** obj_delta.c	26 Nov 2002 03:23:10 -0000	1.4
--- obj_delta.c	26 Nov 2002 03:29:17 -0000	1.5
***************
*** 19,30 ****
  		if (PyType_IsSubtype(right_type, &PyDateTime_DeltaType)) {
  			/* delta + delta */
! 			long int days = GET_TD_DAYS(delta) +
! 					GET_TD_DAYS(right);
! 			long int seconds = GET_TD_SECONDS(delta) +
! 					   GET_TD_SECONDS(right);
! 			long int microseconds = GET_TD_MICROSECONDS(delta) +
! 						GET_TD_MICROSECONDS(right);
  			return new_delta(days, seconds, microseconds);
  		}
  		other = right;
  		other_type = right_type;
--- 19,31 ----
  		if (PyType_IsSubtype(right_type, &PyDateTime_DeltaType)) {
  			/* delta + delta */
! 			const long days = GET_TD_DAYS(delta) +
! 					  GET_TD_DAYS(right);
! 			const long seconds = GET_TD_SECONDS(delta) +
! 					     GET_TD_SECONDS(right);
! 			const long microseconds = GET_TD_MICROSECONDS(delta) +
! 						  GET_TD_MICROSECONDS(right);
  			return new_delta(days, seconds, microseconds);
  		}
+ 		/* XXX This code is unused. */
  		other = right;
  		other_type = right_type;
***************
*** 32,35 ****
--- 33,37 ----
  	else {
  		/* !delta + delta */
+ 		/* XXX This code is unused. */
  		delta = (PyDateTime_Delta *) right;
  		other = left;