[Python-checkins] CVS: python/dist/src/Objects unicodeobject.c,2.49,2.50

Greg Stein python-dev@python.org
Mon, 17 Jul 2000 02:04:46 -0700


Update of /cvsroot/python/python/dist/src/Objects
In directory slayer.i.sourceforge.net:/tmp/cvs-serv2235

Modified Files:
	unicodeobject.c 
Log Message:
gcc is being stupid with if/else constructs
clean out some other warnings



Index: unicodeobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v
retrieving revision 2.49
retrieving revision 2.50
diff -C2 -r2.49 -r2.50
*** unicodeobject.c	2000/07/16 21:39:49	2.49
--- unicodeobject.c	2000/07/17 09:04:43	2.50
***************
*** 422,432 ****
  	v = PyUnicode_Decode(s, len, encoding, errors);
   done:
!     if (owned)
  	Py_DECREF(obj);
      return v;
  
   onError:
!     if (owned)
  	Py_DECREF(obj);
      return NULL;
  }
--- 422,434 ----
  	v = PyUnicode_Decode(s, len, encoding, errors);
   done:
!     if (owned) {
  	Py_DECREF(obj);
+     }
      return v;
  
   onError:
!     if (owned) {
  	Py_DECREF(obj);
+     }
      return NULL;
  }
***************
*** 633,641 ****
  
  #define UTF8_ERROR(details) \
!   if (1) {                                                  \
        if (utf8_decoding_error(&s, &p, errors, (details)))   \
            goto onError;                                     \
!       continue;                                             \
!   } else
  
  PyObject *PyUnicode_DecodeUTF8(const char *s,
--- 635,643 ----
  
  #define UTF8_ERROR(details) \
!   do {                                                      \
        if (utf8_decoding_error(&s, &p, errors, (details)))   \
            goto onError;                                     \
!       goto nextchar;                                        \
!   } while (0)
  
  PyObject *PyUnicode_DecodeUTF8(const char *s,
***************
*** 733,736 ****
--- 735,741 ----
          }
          s += n;
+ 
+       nextchar:
+         ;
      }
  
***************
*** 748,751 ****
--- 753,758 ----
  #undef UTF8_ERROR
  
+ /* NOT USED */
+ #if 0
  static
  int utf8_encoding_error(const Py_UNICODE **source,
***************
*** 777,780 ****
--- 784,788 ----
      }
  }
+ #endif /* NOT USED */
  
  PyObject *PyUnicode_EncodeUTF8(const Py_UNICODE *s,
***************
*** 827,831 ****
                      
                          *p++ = (char)((ch >> 18) | 0xf0);
!                         *p++ = (char)(0x80 | (ch >> 12) & 0x3f);
                          i++;
                          cbWritten += 4;
--- 835,839 ----
                      
                          *p++ = (char)((ch >> 18) | 0xf0);
!                         *p++ = (char)(0x80 | ((ch >> 12) & 0x3f));
                          i++;
                          cbWritten += 4;