[Python-checkins] python/nondist/sandbox/datetime obj_datetime.c,1.10,1.11

tim_one@users.sourceforge.net tim_one@users.sourceforge.net
Mon, 02 Dec 2002 15:28:15 -0800


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

Modified Files:
	obj_datetime.c 
Log Message:
Folded long lines.


Index: obj_datetime.c
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/datetime/obj_datetime.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** obj_datetime.c	2 Dec 2002 22:07:17 -0000	1.10
--- obj_datetime.c	2 Dec 2002 23:28:13 -0000	1.11
***************
*** 159,165 ****
  		PyObject *temp;
  		temp = Py_BuildValue("lllllll", GET_YEAR(self),
! 				     GET_MONTH(self), GET_DAY(self),
! 				     GET_HOUR(self), GET_MINUTE(self),
! 				     GET_SECOND(self), GET_MICROSECOND(self));
  		if (temp != NULL) {
  			self->hashcode = PyObject_Hash(temp);
--- 159,165 ----
  		PyObject *temp;
  		temp = Py_BuildValue("lllllll", GET_YEAR(self),
! 				      GET_MONTH(self), GET_DAY(self),
! 				      GET_HOUR(self), GET_MINUTE(self),
! 				      GET_SECOND(self), GET_MICROSECOND(self));
  		if (temp != NULL) {
  			self->hashcode = PyObject_Hash(temp);
***************
*** 174,181 ****
  {
  	PyObject *self = NULL;
! 	long int year, month, day, hour = 0, minute = 0, second = 0, usecond = 0;
  
  	static char *keywords[] = {
! 		"year", "month", "day", "hour", "minute", "second", "microsecond", NULL
  	};
  
--- 174,188 ----
  {
  	PyObject *self = NULL;
! 	long year;
! 	long month;
! 	long day;
! 	long hour = 0;
! 	long minute = 0;
! 	long second = 0;
! 	long usecond = 0;
  
  	static char *keywords[] = {
! 		"year", "month", "day", "hour", "minute", "second",
! 		"microsecond", NULL
  	};
  
***************
*** 184,208 ****
  					&second, &usecond)) {
  		if (year < MINYEAR || year > MAXYEAR) {
! 			PyErr_SetString(PyExc_ValueError, "year is out of range");
  			return NULL;
  		}
  		if (month < 1 || month > 12) {
! 			PyErr_SetString(PyExc_ValueError, "month must be in 1..12");
  			return NULL;
  		}
  		if (day < 1 || day > days_in_month(year, month)) {
! 			PyErr_SetString(PyExc_ValueError, "day is out of range for month");
  			return NULL;
  		}
  		if (hour < 0 || hour > 23) {
! 			PyErr_SetString(PyExc_ValueError, "hour must be in 0..23");
  			return NULL;
  		}
  		if (minute < 0 || minute > 59) {
! 			PyErr_SetString(PyExc_ValueError, "minute must be in 0..59");
  			return NULL;
  		}
  		if (second < 0 || second > 59) {
! 			PyErr_SetString(PyExc_ValueError, "second must be in 0..59");
  			return NULL;
  		}
--- 191,221 ----
  					&second, &usecond)) {
  		if (year < MINYEAR || year > MAXYEAR) {
! 			PyErr_SetString(PyExc_ValueError,
! 					"year is out of range");
  			return NULL;
  		}
  		if (month < 1 || month > 12) {
! 			PyErr_SetString(PyExc_ValueError,
! 					"month must be in 1..12");
  			return NULL;
  		}
  		if (day < 1 || day > days_in_month(year, month)) {
! 			PyErr_SetString(PyExc_ValueError,
! 					"day is out of range for month");
  			return NULL;
  		}
  		if (hour < 0 || hour > 23) {
! 			PyErr_SetString(PyExc_ValueError,
! 					"hour must be in 0..23");
  			return NULL;
  		}
  		if (minute < 0 || minute > 59) {
! 			PyErr_SetString(PyExc_ValueError,
! 					"minute must be in 0..59");
  			return NULL;
  		}
  		if (second < 0 || second > 59) {
! 			PyErr_SetString(PyExc_ValueError,
! 					"second must be in 0..59");
  			return NULL;
  		}
***************
*** 212,216 ****
  			return NULL;
  		}
! 		self = new_datetime(year, month, day, hour, minute, second, usecond);
  	}
  	return self;
--- 225,230 ----
  			return NULL;
  		}
! 		self = new_datetime(year, month, day, hour, minute, second,
! 				     usecond);
  	}
  	return self;