]> granicus.if.org Git - transmission/commitdiff
Define each identifier in a dedicated statement
authorMike Gelfand <mikedld@mikedld.com>
Sun, 17 Mar 2019 06:15:35 +0000 (09:15 +0300)
committerMike Gelfand <mikedld@mikedld.com>
Sun, 17 Mar 2019 06:15:35 +0000 (09:15 +0300)
* MISRA C++:2008, 8-0-1 - An init-declarator-list or a member-declarator-list
  shall consist of a single init-declarator or member-declarator respectively
* CERT, DCL52-J. - Do not declare more than one variable per declaration
* CERT, DCL04-C. - Do not declare more than one variable per declaration

gtk/makemeta-ui.c
gtk/torrent-cell-renderer.c
libtransmission/utils.c

index 7e01fcef687f3dddc2c4cdfb93599632908ab891..ab15306a9a5e45a9131358c1ae92a0ceaad6b996 100644 (file)
@@ -219,7 +219,8 @@ static void onResponse(GtkDialog* d, int response, gpointer user_data)
         {
             int n;
             int tier;
-            GtkTextIter start, end;
+            GtkTextIter start;
+            GtkTextIter end;
             char* dir;
             char* base;
             char* tracker_text;
index 59ecd8220671ee6c809a57bef96c3d91ae49a917..3e9f187a00000ba2ba7eb7b4db601f2b9c8a8093 100644 (file)
@@ -153,7 +153,8 @@ static char* getShortTransferString(tr_torrent const* tor, tr_stat const* st, do
 
     if (haveDown)
     {
-        char dnStr[32], upStr[32];
+        char dnStr[32];
+        char upStr[32];
         tr_formatter_speed_KBps(dnStr, downloadSpeed_KBps, sizeof(dnStr));
         tr_formatter_speed_KBps(upStr, uploadSpeed_KBps, sizeof(upStr));
 
@@ -513,7 +514,8 @@ static void torrent_cell_renderer_get_size(GtkCellRenderer* cell, GtkWidget* wid
 
         if (y_offset != NULL)
         {
-            int xpad, ypad;
+            int xpad;
+            int ypad;
             gtk_cell_renderer_get_padding(cell, &xpad, &ypad);
             *y_offset = cell_area ? (int)((cell_area->height - (ypad * 2 + h)) / 2.0) : 0;
         }
index 10b389abdd1bbb80f4fcda44fd4bc684e95ed4e4..250c06dbb367db5465e6cdcdc0aeaa8599eeb7fc 100644 (file)
@@ -1726,7 +1726,8 @@ bool tr_moveFile(char const* oldpath, char const* newpath, tr_error** error)
     while (bytesLeft > 0)
     {
         uint64_t const bytesThisPass = MIN(bytesLeft, buflen);
-        uint64_t numRead, bytesWritten;
+        uint64_t numRead;
+        uint64_t bytesWritten;
 
         if (!tr_sys_file_read(in, buf, bytesThisPass, &numRead, error))
         {