D8317: cext: move more variable declarations to the top of the block for C89 support

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

D8317: cext: move more variable declarations to the top of the block for C89 support

martinvonz (Martin von Zweigbergk)
mharbison72 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  These instances aren't compiled on Windows, so they don't matter much.  But they
  do get flagged by `-Werror=declaration-after-statement` in the next patch.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D8317

AFFECTED FILES
  mercurial/cext/osutil.c

CHANGE DETAILS

diff --git a/mercurial/cext/osutil.c b/mercurial/cext/osutil.c
--- a/mercurial/cext/osutil.c
+++ b/mercurial/cext/osutil.c
@@ -810,9 +810,10 @@
  /* Check the memory we can use. Typically, argv[i] and
  * argv[i + 1] are continuous. */
  for (i = 0; i < argc; ++i) {
+ size_t len;
  if (argv[i] > argvend || argv[i] < argvstart)
  break; /* not continuous */
- size_t len = strlen(argv[i]);
+ len = strlen(argv[i]);
  argvend = argv[i] + len + 1 /* '\0' */;
  }
  if (argvend > argvstart) /* sanity check */
@@ -1170,9 +1171,9 @@
 {
  int sig = 0;
  int r;
+ sigset_t set;
  if (!PyArg_ParseTuple(args, "i", &sig))
  return NULL;
- sigset_t set;
  r = sigemptyset(&set);
  if (r != 0)
  return PyErr_SetFromErrno(PyExc_OSError);



To: mharbison72, #hg-reviewers
Cc: mercurial-devel
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

D8317: cext: move more variable declarations to the top of the block for C89 support

martinvonz (Martin von Zweigbergk)
mharbison72 added a comment.
mharbison72 abandoned this revision.


  Duplicate of 0424a9134bcf <https://phab.mercurial-scm.org/rHG0424a9134bcfe08dffc9e5b5e63f1a7dd33d284b>

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8317/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8317

To: mharbison72, #hg-reviewers
Cc: mercurial-devel
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel