]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Revert my commit 7ba176c2f558: "Avoid useless "++" at the end of functions
authorVictor Stinner <victor.stinner@haypocalc.com>
Fri, 27 May 2011 14:46:51 +0000 (16:46 +0200)
committerVictor Stinner <victor.stinner@haypocalc.com>
Fri, 27 May 2011 14:46:51 +0000 (16:46 +0200)
Warnings found by the Clang Static Analyzer."

Most people prefer ++ at the end of functions.

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

index ebfddb398ccc5afa2d87e073fe2521a5902f60e4..2e6251884c5d4bde46ecaea91532a5718e026b31 100644 (file)
@@ -616,7 +616,7 @@ set_repr(PySetObject *so)
     Py_UNICODE_COPY(u, PyUnicode_AS_UNICODE(listrepr)+1,
                        newsize-2);
     u += newsize-2;
-    *u = '}';
+    *u++ = '}';
     Py_DECREF(listrepr);
 
     if (Py_TYPE(so) != &PySet_Type) {
index 309159cc47975f9eb0fe2065ed9908314dc78536..4361908c3a87bb634f7dc2d8f3500a9993f45208 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 96d01cdcc878c74d80d521a6ba839fd4446d1174..34e7603b3a560f8ecedfa7b92d18afca5b22ba11 100644 (file)
@@ -3744,11 +3744,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;
@@ -3793,7 +3793,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;
 }