qemacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemacs-devel] [PATCH] C89


From: François Revol
Subject: [Qemacs-devel] [PATCH] C89
Date: Mon, 06 Jan 2014 12:08:09 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130630 Icedove/17.0.7

Fixes gcc 4.8.2 complaint (and C89 is required for Haiku as well):
buffer.c:903:5: error: ‘for’ loop initial declarations are only allowed
in C99 mode
     for (int n = 0; n < b->nb_pages; n++) {
     ^
buffer.c:903:5: note: use option -std=c99 or -std=gnu99 to compile your code


François.

Index: buffer.c
===================================================================
RCS file: /sources/qemacs/qemacs/buffer.c,v
retrieving revision 1.51
diff -u -r1.51 buffer.c
--- buffer.c    6 Jan 2014 09:40:20 -0000       1.51
+++ buffer.c    6 Jan 2014 11:06:01 -0000
@@ -890,6 +890,8 @@

 void eb_set_charset(EditBuffer *b, QECharset *charset)
 {
+    int n;
+
     if (b->charset) {
         charset_decode_close(&b->charset_state);
     }
@@ -900,7 +902,7 @@
     charset_decode_init(&b->charset_state, charset);

     /* Reset page cache flags */
-    for (int n = 0; n < b->nb_pages; n++) {
+    for (n = 0; n < b->nb_pages; n++) {
         Page *p = &b->page_table[n];
         p->flags &= ~(PG_VALID_POS | PG_VALID_CHAR | PG_VALID_COLORS);
     }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]