@@ -398,26 +398,29 @@ static int SPBObj_setattr(self, name, value)
398398 PyObject * value ;
399399{
400400
401- if (strcmp (name , "inRefNum" ) == 0 )
402- return PyArg_Parse (value , "l" , & self -> ob_spb .inRefNum );
403- else if (strcmp (name , "count" ) == 0 )
404- return PyArg_Parse (value , "l" , & self -> ob_spb .count );
405- else if (strcmp (name , "milliseconds" ) == 0 )
406- return PyArg_Parse (value , "l" , & self -> ob_spb .milliseconds );
407- else if (strcmp (name , "buffer" ) == 0 )
408- return PyArg_Parse (value , "w#" , & self -> ob_spb .bufferPtr , & self -> ob_spb .bufferLength );
409- else if (strcmp (name , "completionRoutine" ) == 0 ) {
410- self -> ob_spb .completionRoutine = NewSICompletionProc (SPB_completion );
411- self -> ob_completion = value ;
412- Py_INCREF (value );
413- return 0 ;
414- } else if (strcmp (name , "interruptRoutine" ) == 0 ) {
415- self -> ob_spb .completionRoutine = NewSIInterruptProc (SPB_interrupt );
416- self -> ob_interrupt = value ;
417- Py_INCREF (value );
418- return 0 ;
419- }
420- return -1 ;
401+ int rv = 0 ;
402+
403+ if (strcmp (name , "inRefNum" ) == 0 )
404+ rv = PyArg_Parse (value , "l" , & self -> ob_spb .inRefNum );
405+ else if (strcmp (name , "count" ) == 0 )
406+ rv = PyArg_Parse (value , "l" , & self -> ob_spb .count );
407+ else if (strcmp (name , "milliseconds" ) == 0 )
408+ rv = PyArg_Parse (value , "l" , & self -> ob_spb .milliseconds );
409+ else if (strcmp (name , "buffer" ) == 0 )
410+ rv = PyArg_Parse (value , "w#" , & self -> ob_spb .bufferPtr , & self -> ob_spb .bufferLength );
411+ else if (strcmp (name , "completionRoutine" ) == 0 ) {
412+ self -> ob_spb .completionRoutine = NewSICompletionProc (SPB_completion );
413+ self -> ob_completion = value ;
414+ Py_INCREF (value );
415+ rv = 1 ;
416+ } else if (strcmp (name , "interruptRoutine" ) == 0 ) {
417+ self -> ob_spb .completionRoutine = NewSIInterruptProc (SPB_interrupt );
418+ self -> ob_interrupt = value ;
419+ Py_INCREF (value );
420+ rv = 1 ;
421+ }
422+ if ( rv ) return 0 ;
423+ else return -1 ;
421424}
422425
423426staticforward PyTypeObject SPB_Type = {
0 commit comments