]> granicus.if.org Git - python/commitdiff
Avoid useless "++" at the end of functions
authorVictor Stinner <victor.stinner@haypocalc.com>
Thu, 26 May 2011 11:53:47 +0000 (13:53 +0200)
committerVictor Stinner <victor.stinner@haypocalc.com>
Thu, 26 May 2011 11:53:47 +0000 (13:53 +0200)
Warnings found by the Clang Static Analyzer.

Objects/setobject.c
Objects/unicodeobject.c
Python/compile.c

index 48edad8a31a32547773f2d567e2a0ef2c84aec4e..22243eaa6c03f63a4a5ff9a1a6049971869a0f44 100644 (file)
@@ -612,9 +612,9 @@ set_repr(PySetObject *so)
         *u++ = '{';
         /* Omit the brackets from the listrepr */
         Py_UNICODE_COPY(u, PyUnicode_AS_UNICODE(listrepr)+1,
-                           PyUnicode_GET_SIZE(listrepr)-2);
+                           newsize-2);
         u += newsize-2;
-        *u++ = '}';
+        *u = '}';
     }
     Py_DECREF(listrepr);
     if (Py_TYPE(so) != &PySet_Type) {
index 4361908c3a87bb634f7dc2d8f3500a9993f45208..309159cc47975f9eb0fe2065ed9908314dc78536 100644 (file)
@@ -6474,7 +6474,7 @@ PyUnicode_EncodeDecimal(Py_UNICODE *s,
         }
     }
     /* 0-terminate the output string */
-    *output++ = '\0';
+    *output = '\0';
     Py_XDECREF(exc);
     Py_XDECREF(errorHandler);
     return 0;
index 53f5a12cc3dfe56a639d03714084f1ffa74f6bc1..d195967e7c44cf508d4afc4aeeed9c2975b23341 100644 (file)
@@ -3747,11 +3747,11 @@ assemble_lnotab(struct assembler *a, struct instr *i)
     a->a_lnotab_off += 2;
     if (d_bytecode) {
         *lnotab++ = d_bytecode;
-        *lnotab++ = d_lineno;
+        *lnotab = d_lineno;
     }
     else {      /* First line of a block; def stmt, etc. */
         *lnotab++ = 0;
-        *lnotab++ = d_lineno;
+        *lnotab = d_lineno;
     }
     a->a_lineno = i->i_lineno;
     a->a_lineno_off = a->a_offset;
@@ -3796,7 +3796,7 @@ assemble_emit(struct assembler *a, struct instr *i)
     if (i->i_hasarg) {
         assert(size == 3 || size == 6);
         *code++ = arg & 0xff;
-        *code++ = arg >> 8;
+        *code = arg >> 8;
     }
     return 1;
 }