]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix thinko in _cpp_remaining_tokens_num_in_context
authorDodji Seketeli <dodji@redhat.com>
Thu, 20 Oct 2011 08:49:29 +0000 (08:49 +0000)
committerDodji Seketeli <dodji@gcc.gnu.org>
Thu, 20 Oct 2011 08:49:29 +0000 (10:49 +0200)
libcpp/

* lex.c (_cpp_remaining_tokens_num_in_context): Fix computation of
number of tokens.

From-SVN: r180239

libcpp/ChangeLog
libcpp/lex.c

index bbb4085f012ea5d713f42106bbd713e9bddfd4de..128d3e1cec01bf057286d15e198d8d4d5acb0a24 100644 (file)
@@ -1,3 +1,9 @@
+2011-10-20  Dodji Seketeli  <dodji@redhat.com>
+
+       PR bootstrap/50801
+       * lex.c (_cpp_remaining_tokens_num_in_context): Fix computation of
+       number of tokens.
+
 2011-10-18  Dodji Seketeli  <dodji@redhat.com>
 
        PR bootstrap/50760
index cd6ae9f67ddd049422e6866973df8032077c6a64..527368b8607a46bd0bc2ae38d8fa5634e0e5f595 100644 (file)
@@ -1710,12 +1710,10 @@ _cpp_remaining_tokens_num_in_context (cpp_reader *pfile)
 {
   cpp_context *context = pfile->context;
   if (context->tokens_kind == TOKENS_KIND_DIRECT)
-    return ((LAST (context).token - FIRST (context).token)
-           / sizeof (cpp_token));
+    return (LAST (context).token - FIRST (context).token);
   else if (context->tokens_kind == TOKENS_KIND_INDIRECT
           || context->tokens_kind == TOKENS_KIND_EXTENDED)
-    return ((LAST (context).ptoken - FIRST (context).ptoken)
-           / sizeof (cpp_token *));
+    return (LAST (context).ptoken - FIRST (context).ptoken);
   else
       abort ();
 }