This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch main
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=8077899fa07aa89af531c90a8b635f0ffe803ecb

commit 8077899fa07aa89af531c90a8b635f0ffe803ecb
Author: Guillem Jover <[email protected]>
AuthorDate: Tue Dec 6 18:55:53 2022 +0100

    lib: Stop using register keyword
    
    This keyword is just a hint, and the compiler is in a way better
    position to decide where to allocate these variables. In C++ the
    keyword is deprecated and in C++17 it cannot be used.
---
 lib/compat/getopt.c  |  4 ++--
 lib/compat/obstack.c | 26 +++++++++++++-------------
 lib/dpkg/strhash.c   |  4 ++--
 3 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/lib/compat/getopt.c b/lib/compat/getopt.c
index b13f81454..f28154398 100644
--- a/lib/compat/getopt.c
+++ b/lib/compat/getopt.c
@@ -340,7 +340,7 @@ exchange (argv)
        {
          /* Bottom segment is the short one.  */
          int len = middle - bottom;
-         register int i;
+         int i;
 
          /* Swap it with the top part of the top segment.  */
          for (i = 0; i < len; i++)
@@ -357,7 +357,7 @@ exchange (argv)
        {
          /* Top segment is the short one.  */
          int len = top - middle;
-         register int i;
+         int i;
 
          /* Swap it with the bottom part of the bottom segment.  */
          for (i = 0; i < len; i++)
diff --git a/lib/compat/obstack.c b/lib/compat/obstack.c
index 136fd33b5..13975aa41 100644
--- a/lib/compat/obstack.c
+++ b/lib/compat/obstack.c
@@ -149,7 +149,7 @@ _obstack_begin (struct obstack *h,
                void *(*chunkfun) (long),
                void (*freefun) (void *))
 {
-  register struct _obstack_chunk *chunk; /* points to new chunk */
+  struct _obstack_chunk *chunk; /* points to new chunk */
 
   if (alignment == 0)
     alignment = DEFAULT_ALIGNMENT;
@@ -196,7 +196,7 @@ _obstack_begin_1 (struct obstack *h, int size, int 
alignment,
                  void (*freefun) (void *, void *),
                  void *arg)
 {
-  register struct _obstack_chunk *chunk; /* points to new chunk */
+  struct _obstack_chunk *chunk; /* points to new chunk */
 
   if (alignment == 0)
     alignment = DEFAULT_ALIGNMENT;
@@ -247,11 +247,11 @@ _obstack_begin_1 (struct obstack *h, int size, int 
alignment,
 void
 _obstack_newchunk (struct obstack *h, int length)
 {
-  register struct _obstack_chunk *old_chunk = h->chunk;
-  register struct _obstack_chunk *new_chunk;
-  register long        new_size;
-  register long obj_size = h->next_free - h->object_base;
-  register long i;
+  struct _obstack_chunk *old_chunk = h->chunk;
+  struct _obstack_chunk *new_chunk;
+  long new_size;
+  long obj_size = h->next_free - h->object_base;
+  long i;
   long already;
   char *object_base;
 
@@ -324,8 +324,8 @@ int _obstack_allocated_p (struct obstack *h, void *obj);
 int
 _obstack_allocated_p (struct obstack *h, void *obj)
 {
-  register struct _obstack_chunk *lp;  /* below addr of any objects in this 
chunk */
-  register struct _obstack_chunk *plp; /* point to previous chunk if any */
+  struct _obstack_chunk *lp;   /* below addr of any objects in this chunk */
+  struct _obstack_chunk *plp;  /* point to previous chunk if any */
 
   lp = (h)->chunk;
   /* We use >= rather than > since the object cannot be exactly at
@@ -347,8 +347,8 @@ _obstack_allocated_p (struct obstack *h, void *obj)
 void
 __obstack_free (struct obstack *h, void *obj)
 {
-  register struct _obstack_chunk *lp;  /* below addr of any objects in this 
chunk */
-  register struct _obstack_chunk *plp; /* point to previous chunk if any */
+  struct _obstack_chunk *lp;   /* below addr of any objects in this chunk */
+  struct _obstack_chunk *plp;  /* point to previous chunk if any */
 
   lp = h->chunk;
   /* We use >= because there cannot be an object at the beginning of a chunk.
@@ -383,8 +383,8 @@ strong_alias (obstack_free, _obstack_free)
 int
 _obstack_memory_used (struct obstack *h)
 {
-  register struct _obstack_chunk* lp;
-  register int nbytes = 0;
+  struct _obstack_chunk* lp;
+  int nbytes = 0;
 
   for (lp = h->chunk; lp != 0; lp = lp->prev)
     {
diff --git a/lib/dpkg/strhash.c b/lib/dpkg/strhash.c
index ed364695e..7fd51eee1 100644
--- a/lib/dpkg/strhash.c
+++ b/lib/dpkg/strhash.c
@@ -38,8 +38,8 @@
 unsigned int
 str_fnv_hash(const char *str)
 {
-       register unsigned int h = FNV_OFFSET_BASIS;
-       register unsigned int p = FNV_MIXING_PRIME;
+       unsigned int h = FNV_OFFSET_BASIS;
+       unsigned int p = FNV_MIXING_PRIME;
 
        while (*str) {
                h ^= *str++;

-- 
Dpkg.Org's dpkg

Reply via email to