[PATCH] C89
François Revol <[email protected]> Mon, 06 Jan 2014 12:08:09 +0100
| Newsgroups | gmane.editors.qemacs.devel |
|---|---|
| Message-ID | <[email protected]> |
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);
}
_______________________________________________
Qemacs-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/qemacs-devel