qemacs-commit
[Top][All Lists]
Advanced

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

[Qemacs-commit] qemacs charset.c charsetjis.c charsetmore.c cpt...


From: Charlie Gordon
Subject: [Qemacs-commit] qemacs charset.c charsetjis.c charsetmore.c cpt...
Date: Wed, 19 Aug 2015 16:22:31 +0000

CVSROOT:        /sources/qemacs
Module name:    qemacs
Changes by:     Charlie Gordon <chqrlie>        15/08/19 16:22:31

Modified files:
        .              : charset.c charsetjis.c charsetmore.c cptoqe.c 
                         qe.h search.c 

Log message:
        general: sanity checks
        - make QECharset const by default, use struct QECharset for mutable 
references.
        - use OWNED attribute to flag unique pointers to allocated memory.
        - add typedefs for InputMethod, ISearchState
        - use typedef for ModeDef

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemacs/charset.c?cvsroot=qemacs&r1=1.39&r2=1.40
http://cvs.savannah.gnu.org/viewcvs/qemacs/charsetjis.c?cvsroot=qemacs&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/qemacs/charsetmore.c?cvsroot=qemacs&r1=1.19&r2=1.20
http://cvs.savannah.gnu.org/viewcvs/qemacs/cptoqe.c?cvsroot=qemacs&r1=1.17&r2=1.18
http://cvs.savannah.gnu.org/viewcvs/qemacs/qe.h?cvsroot=qemacs&r1=1.199&r2=1.200
http://cvs.savannah.gnu.org/viewcvs/qemacs/search.c?cvsroot=qemacs&r1=1.1&r2=1.2

Patches:
Index: charset.c
===================================================================
RCS file: /sources/qemacs/qemacs/charset.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -b -r1.39 -r1.40
--- charset.c   11 Aug 2015 17:45:30 -0000      1.39
+++ charset.c   19 Aug 2015 16:22:30 -0000      1.40
@@ -21,7 +21,8 @@
 
 #include "qe.h"
 
-QECharset *first_charset;
+/* XXX: Should move this to QEmacsState, and find a way for html2png */
+struct QECharset *first_charset;
 
 /* Unicode utilities */
 
@@ -116,7 +117,7 @@
     }
 }
 
-QECharset charset_raw = {
+struct QECharset charset_raw = {
     "raw",
     "binary|none",
     NULL,
@@ -188,7 +189,7 @@
     }
 }
 
-QECharset charset_8859_1 = {
+struct QECharset charset_8859_1 = {
     "8859-1",
     "ISO-8859-1|iso-ir-100|latin1|l1|819",
     probe_8859_1,
@@ -220,7 +221,7 @@
     }
 }
 
-QECharset charset_vt100 = {
+struct QECharset charset_vt100 = {
     "vt100",
     NULL,
     NULL,
@@ -247,7 +248,7 @@
     }
 }
 
-static QECharset charset_7bit = {
+static struct QECharset charset_7bit = {
     "7bit",
     "us-ascii|ascii|7-bit|iso-ir-6|ANSI_X3.4|646",
     NULL,
@@ -547,7 +548,7 @@
     return buf_ptr - buf;
 }
 
-QECharset charset_utf8 = {
+struct QECharset charset_utf8 = {
     "utf-8",
     "utf8",
     probe_utf8,
@@ -816,7 +817,7 @@
     return (const u8*)buf_ptr - buf;
 }
 
-QECharset charset_ucs2le = {
+struct QECharset charset_ucs2le = {
     "ucs2le",
     "utf16le|utf-16le",
     probe_ucs2le,
@@ -830,7 +831,7 @@
     2, 0, 0, 10, 0, 0, NULL, NULL,
 };
 
-QECharset charset_ucs2be = {
+struct QECharset charset_ucs2be = {
     "ucs2be",
     "ucs2|utf16|utf-16|utf16be|utf-16be",
     probe_ucs2be,
@@ -1088,7 +1089,7 @@
     return (const u8*)buf_ptr - buf;
 }
 
-QECharset charset_ucs4le = {
+struct QECharset charset_ucs4le = {
     "ucs4le",
     "utf32le|utf-32le",
     probe_ucs4le,
@@ -1102,7 +1103,7 @@
     4, 0, 0, 10, 0, 0, NULL, NULL,
 };
 
-QECharset charset_ucs4be = {
+struct QECharset charset_ucs4be = {
     "ucs4be",
     "ucs4|utf32|utf-32|utf32be|utf-32be",
     probe_ucs4be,
@@ -1119,9 +1120,9 @@
 /********************************************************/
 /* generic charset functions */
 
-void qe_register_charset(QECharset *charset)
+void qe_register_charset(struct QECharset *charset)
 {
-    QECharset **pp;
+    struct QECharset **pp;
 
     if (!charset->aliases)
         charset->aliases = "";

Index: charsetjis.c
===================================================================
RCS file: /sources/qemacs/qemacs/charsetjis.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- charsetjis.c        1 Mar 2014 22:37:26 -0000       1.7
+++ charsetjis.c        19 Aug 2015 16:22:30 -0000      1.8
@@ -142,7 +142,7 @@
     return q;
 }
 
-static QECharset charset_euc_jp = {
+static struct QECharset charset_euc_jp = {
     "euc-jp",
     NULL,
     NULL,
@@ -222,7 +222,7 @@
     return q;
 }
 
-static QECharset charset_sjis = {
+static struct QECharset charset_sjis = {
     "sjis",
     NULL,
     NULL,

Index: charsetmore.c
===================================================================
RCS file: /sources/qemacs/qemacs/charsetmore.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- charsetmore.c       1 Mar 2014 22:37:26 -0000       1.19
+++ charsetmore.c       19 Aug 2015 16:22:30 -0000      1.20
@@ -45,7 +45,7 @@
     0x016f, 0x00fa, 0x0171, 0x00fc, 0x00fd, 0x0163, 0x02d9,
 };
 
-static QECharset charset_8859_2 = {
+static struct QECharset charset_8859_2 = {
     "8859-2",
     "ISO-8859-2|iso-ir-101|latin2|l2|iso-latin2",
     NULL,
@@ -88,7 +88,7 @@
     0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x016d, 0x015d, 0x02d9,
 };
 
-static QECharset charset_8859_3 = {
+static struct QECharset charset_8859_3 = {
     "8859-3",
     "ISO-8859-3",
     NULL,
@@ -131,7 +131,7 @@
     0x0173, 0x00fa, 0x00fb, 0x00fc, 0x0169, 0x016b, 0x02d9,
 };
 
-static QECharset charset_8859_4 = {
+static struct QECharset charset_8859_4 = {
     "8859-4",
     "ISO-8859-4|iso-ir-110|latin4|l4|iso-latin4",
     NULL,
@@ -174,7 +174,7 @@
     0x0459, 0x045a, 0x045b, 0x045c, 0x00a7, 0x045e, 0x045f,
 };
 
-static QECharset charset_8859_5 = {
+static struct QECharset charset_8859_5 = {
     "8859-5",
     "ISO-8859-5",
     NULL,
@@ -214,7 +214,7 @@
     0x064c, 0x064d, 0x064e, 0x064f, 0x0650, 0x0651, 0x0652,
 };
 
-static QECharset charset_8859_6 = {
+static struct QECharset charset_8859_6 = {
     "8859-6",
     "ISO-8859-6",
     NULL,
@@ -257,7 +257,7 @@
     0x03c9, 0x03ca, 0x03cb, 0x03cc, 0x03cd, 0x03ce,
 };
 
-static QECharset charset_8859_7 = {
+static struct QECharset charset_8859_7 = {
     "8859-7",
     "ISO-8859-7|iso-ir-126|elot-928",
     NULL,
@@ -299,7 +299,7 @@
     0x05ea, 0x00fb, 0x00fc, 0x200e, 0x200f,
 };
 
-static QECharset charset_8859_8 = {
+static struct QECharset charset_8859_8 = {
     "8859-8",
     "ISO-8859-8",
     NULL,
@@ -336,7 +336,7 @@
     0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x0131, 0x015f,
 };
 
-static QECharset charset_8859_9 = {
+static struct QECharset charset_8859_9 = {
     "8859-9",
     "ISO-8859-9",
     NULL,
@@ -379,7 +379,7 @@
     0x0173, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x0138,
 };
 
-static QECharset charset_8859_10 = {
+static struct QECharset charset_8859_10 = {
     "8859-10",
     "ISO-8859-10",
     NULL,
@@ -422,7 +422,7 @@
     0x0e59, 0x0e5a, 0x0e5b,
 };
 
-static QECharset charset_8859_11 = {
+static struct QECharset charset_8859_11 = {
     "8859-11",
     "ISO-8859-11",
     NULL,
@@ -465,7 +465,7 @@
     0x0142, 0x015b, 0x016b, 0x00fc, 0x017c, 0x017e, 0x2019,
 };
 
-static QECharset charset_8859_13 = {
+static struct QECharset charset_8859_13 = {
     "8859-13",
     "ISO-8859-13|iso-ir-179|latin7|l7|iso-latin7",
     NULL,
@@ -508,7 +508,7 @@
     0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x0177,
 };
 
-static QECharset charset_8859_14 = {
+static struct QECharset charset_8859_14 = {
     "8859-14",
     "ISO-8859-14",
     NULL,
@@ -543,7 +543,7 @@
     0x0152, 0x0153, 0x0178,
 };
 
-static QECharset charset_8859_15 = {
+static struct QECharset charset_8859_15 = {
     "8859-15",
     "ISO-8859-15|latin9|l9|latin0|l0",
     NULL,
@@ -586,7 +586,7 @@
     0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x0119, 0x021b,
 };
 
-static QECharset charset_8859_16 = {
+static struct QECharset charset_8859_16 = {
     "8859-16",
     "ISO-8859-16|latin10|l10",
     NULL,
@@ -633,7 +633,7 @@
     0x00b0, 0x2219, 0x00b7, 0x221a, 0x207f, 0x00b2, 0x25a0, 0x00a0,
 };
 
-static QECharset charset_cp437 = {
+static struct QECharset charset_cp437 = {
     "cp437",
     "437",
     NULL,
@@ -680,7 +680,7 @@
     0x00b0, 0x2219, 0x00b7, 0x221a, 0x207f, 0x00b2, 0x25a0, 0x00a0,
 };
 
-static QECharset charset_cp737 = {
+static struct QECharset charset_cp737 = {
     "cp737",
     "737",
     NULL,
@@ -727,7 +727,7 @@
     0x00b0, 0x00a8, 0x00b7, 0x00b9, 0x00b3, 0x00b2, 0x25a0, 0x00a0,
 };
 
-static QECharset charset_cp850 = {
+static struct QECharset charset_cp850 = {
     "cp850",
     "850",
     NULL,
@@ -774,7 +774,7 @@
     0x00b0, 0x00a8, 0x02d9, 0x0171, 0x0158, 0x0159, 0x25a0, 0x00a0,
 };
 
-static QECharset charset_cp852 = {
+static struct QECharset charset_cp852 = {
     "cp852",
     "852",
     NULL,
@@ -821,7 +821,7 @@
     0x00b0, 0x2219, 0x00b7, 0x221a, 0x2116, 0x00a4, 0x25a0, 0x00a0,
 };
 
-static QECharset charset_cp866 = {
+static struct QECharset charset_cp866 = {
     "cp866",
     "866",
     NULL,
@@ -868,7 +868,7 @@
     0x0407, 0x0457, 0x00b7, 0x221a, 0x2116, 0x00a4, 0x25a0, 0x00a0,
 };
 
-static QECharset charset_cp1125 = {
+static struct QECharset charset_cp1125 = {
     "cp1125",
     "x-cp866-u|ruscii|1125",
     NULL,
@@ -915,7 +915,7 @@
     0x0159, 0x016f, 0x00fa, 0x0171, 0x00fc, 0x00fd, 0x0163, 0x02d9,
 };
 
-static QECharset charset_cp1250 = {
+static struct QECharset charset_cp1250 = {
     "cp1250",
     "windows-1250|1250",
     NULL,
@@ -962,7 +962,7 @@
     0x0448, 0x0449, 0x044a, 0x044b, 0x044c, 0x044d, 0x044e, 0x044f,
 };
 
-static QECharset charset_cp1251 = {
+static struct QECharset charset_cp1251 = {
     "cp1251",
     "windows-1251|1251",
     NULL,
@@ -997,7 +997,7 @@
     0x02dc, 0x2122, 0x0161, 0x203a, 0x0153, 0x0000, 0x017e, 0x0178,
 };
 
-static QECharset charset_cp1252 = {
+static struct QECharset charset_cp1252 = {
     "cp1252",
     "windows-1252|1252",
     NULL,
@@ -1044,7 +1044,7 @@
     0x0651, 0x00f9, 0x0652, 0x00fb, 0x00fc, 0x200e, 0x200f, 0x06d2,
 };
 
-static QECharset charset_cp1256 = {
+static struct QECharset charset_cp1256 = {
     "cp1256",
     "windows-1256|1256",
     NULL,
@@ -1091,7 +1091,7 @@
     0x0173, 0x0142, 0x015b, 0x016b, 0x00fc, 0x017c, 0x017e, 0x02d9,
 };
 
-static QECharset charset_cp1257 = {
+static struct QECharset charset_cp1257 = {
     "cp1257",
     "windows-1257|1257",
     NULL,
@@ -1138,7 +1138,7 @@
     0x00dd, 0x00fd, 0x0137, 0x017b, 0x0141, 0x017c, 0x0122, 0x02c7,
 };
 
-static QECharset charset_mac_latin2 = {
+static struct QECharset charset_mac_latin2 = {
     "mac-latin2",
     "x-mac-ce|mac-ce|macce|10029",
     NULL,
@@ -1185,7 +1185,7 @@
     0x00af, 0x02d8, 0x02d9, 0x02da, 0x00b8, 0x02dd, 0x02db, 0x02c7,
 };
 
-QECharset charset_mac_roman = {
+struct QECharset charset_mac_roman = {
     "mac-roman",
     "x-mac|mac",
     NULL,
@@ -1232,7 +1232,7 @@
     0x00b0, 0x2219, 0x00b7, 0x221a, 0x207f, 0x00b2, 0x25a0, 0x00a0,
 };
 
-static QECharset charset_kamen = {
+static struct QECharset charset_kamen = {
     "kamen",
     "x-kam-cs|kam|867|869",
     NULL,
@@ -1279,7 +1279,7 @@
     0x042c, 0x042b, 0x0417, 0x0428, 0x042d, 0x0429, 0x0427, 0x042a,
 };
 
-static QECharset charset_koi8_r = {
+static struct QECharset charset_koi8_r = {
     "koi8-r",
     "",
     NULL,
@@ -1326,7 +1326,7 @@
     0x042c, 0x042b, 0x0417, 0x0428, 0x042d, 0x0429, 0x0427, 0x042a,
 };
 
-static QECharset charset_koi8_u = {
+static struct QECharset charset_koi8_u = {
     "koi8-u",
     "",
     NULL,
@@ -1389,7 +1389,7 @@
     0x1ef1, 0x1ef3, 0x1ef7, 0x1ef9, 0x00fd, 0x1ef5, 0x1ed0,
 };
 
-static QECharset charset_tcvn = {
+static struct QECharset charset_tcvn = {
     "tcvn",
     "TCVN-5712|TCVN|TCVN-0|TCVN-1",
     NULL,
@@ -1452,7 +1452,7 @@
     0x00fa, 0x0169, 0x1ee7, 0x00fd, 0x1ee3, 0x1eee,
 };
 
-static QECharset charset_viscii = {
+static struct QECharset charset_viscii = {
     "viscii",
     "VISCII|VISCII-1|VISCII 1.1|VISCII-1.1|VISCII1.1-1",
     NULL,
@@ -1515,7 +1515,7 @@
     0x00dc, 0x00d9, 0x00da, 0x009f,
 };
 
-static QECharset charset_cp037 = {
+static struct QECharset charset_cp037 = {
     "cp037",
     "037|ebcdic-037",
     NULL,
@@ -1578,7 +1578,7 @@
     0x0000, 0x0000, 0x0000, 0x009f,
 };
 
-static QECharset charset_cp424 = {
+static struct QECharset charset_cp424 = {
     "cp424",
     "424|ebcdic-424",
     NULL,
@@ -1641,7 +1641,7 @@
     0x00dc, 0x00d9, 0x00da, 0x009f,
 };
 
-static QECharset charset_cp500 = {
+static struct QECharset charset_cp500 = {
     "cp500",
     "500|ebcdic-500",
     NULL,
@@ -1704,7 +1704,7 @@
     0x001a, 0x001a, 0x00bb, 0x009f,
 };
 
-static QECharset charset_cp875 = {
+static struct QECharset charset_cp875 = {
     "cp875",
     "875|ebcdic-875",
     NULL,
@@ -1767,7 +1767,7 @@
     0x0022, 0x00d9, 0x00da, 0x009f,
 };
 
-static QECharset charset_cp1026 = {
+static struct QECharset charset_cp1026 = {
     "cp1026",
     "1026|ebcdic-1026",
     NULL,
@@ -1814,7 +1814,7 @@
     0x00b0, 0x2219, 0x00b7, 0x221a, 0x207f, 0x00b2, 0x00b3, 0x00af,
 };
 
-static QECharset charset_atarist = {
+static struct QECharset charset_atarist = {
     "atarist",
     "atari-st",
     NULL,

Index: cptoqe.c
===================================================================
RCS file: /sources/qemacs/qemacs/cptoqe.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- cptoqe.c    1 Mar 2014 22:37:26 -0000       1.17
+++ cptoqe.c    19 Aug 2015 16:22:30 -0000      1.18
@@ -211,7 +211,7 @@
     if (strcmp(name_id, "mac_roman"))
         printf("static ");
 
-    printf("QECharset charset_%s = {\n"
+    printf("struct QECharset charset_%s = {\n"
            "    \"%s\",\n",
            name_id, name);
 

Index: qe.h
===================================================================
RCS file: /sources/qemacs/qemacs/qe.h,v
retrieving revision 1.199
retrieving revision 1.200
diff -u -b -r1.199 -r1.200
--- qe.h        17 Aug 2015 16:56:48 -0000      1.199
+++ qe.h        19 Aug 2015 16:22:30 -0000      1.200
@@ -85,6 +85,8 @@
 #define ssizeof(a)  ((int)(sizeof(a)))
 #endif
 
+#define OWNED     /* ptr attribute for allocated data owned by a structure */
+
 /* prevent gcc warning about shadowing a global declaration */
 #define index  index__
 
@@ -136,6 +138,8 @@
 typedef struct QETimer QETimer;
 typedef struct QEColorizeContext QEColorizeContext;
 typedef struct KeyDef KeyDef;
+typedef struct InputMethod InputMethod;
+typedef struct ISearchState ISearchState;
 
 static inline char *s8(u8 *p) { return (char*)p; }
 static inline const char *cs8(const u8 *p) { return (const char*)p; }
@@ -535,7 +539,7 @@
 #define MAX_CHAR_BYTES 6
 
 typedef struct CharsetDecodeState CharsetDecodeState;
-typedef struct QECharset QECharset;
+typedef const struct QECharset QECharset;
 
 struct QECharset {
     const char *name;
@@ -561,15 +565,15 @@
     struct QECharset *next;
 };
 
-extern QECharset *first_charset;
+extern struct QECharset *first_charset;
 /* predefined charsets */
-extern QECharset charset_raw;
-extern QECharset charset_8859_1;
-extern QECharset charset_utf8;
-extern QECharset charset_vt100; /* used for the tty output */
-extern QECharset charset_ucs2le, charset_ucs2be;
-extern QECharset charset_ucs4le, charset_ucs4be;
-extern QECharset charset_mac_roman;
+extern struct QECharset charset_raw;
+extern struct QECharset charset_8859_1;
+extern struct QECharset charset_utf8;
+extern struct QECharset charset_vt100; /* used for the tty output */
+extern struct QECharset charset_ucs2le, charset_ucs2be;
+extern struct QECharset charset_ucs4le, charset_ucs4be;
+extern struct QECharset charset_mac_roman;
 
 typedef enum EOLType {
     EOL_UNIX = 0,
@@ -598,7 +602,7 @@
 int charset_more_init(void);
 int charset_jis_init(void);
 
-void qe_register_charset(QECharset *charset);
+void qe_register_charset(struct QECharset *charset);
 
 extern unsigned char utf8_length[256];
 static inline int utf8_is_trailing_byte(int c) { return (c & 0xC0) == 0x80; }
@@ -857,7 +861,7 @@
 #define BF_STYLE4    0x3000  /* buffer has 4 byte styles */
 
 struct EditBuffer {
-    Page *page_table;
+    OWNED Page *page_table;
     int nb_pages;
     int mark;       /* current mark (moved with text) */
     int total_size; /* total size of the buffer */
@@ -910,7 +914,7 @@
     int style_shift;
 
     /* modification callbacks */
-    EditBufferCallbackList *first_callback;
+    OWNED EditBufferCallbackList *first_callback;
 
 #if 0
     /* asynchronous loading/saving support */
@@ -925,7 +929,7 @@
      */
     struct ModeDef *default_mode;
     struct ModeDef *saved_mode;
-    struct ModeSavedData *saved_data;
+    OWNED struct ModeSavedData *saved_data;
 
     /* default mode stuff when buffer is detached from window */
     int offset;
@@ -934,7 +938,7 @@
     int fill_column;
     EOLType eol_type;
 
-    EditBuffer *next; /* next editbuffer in qe_state buffer list */
+    OWNED EditBuffer *next; /* next editbuffer in qe_state buffer list */
 
     int st_mode;                        /* unix file mode */
     char name[MAX_BUFFERNAME_SIZE];     /* buffer name */
@@ -1165,12 +1169,12 @@
     /* after this limit, the fields are not saved into the buffer */
     int end_of_saved_data;
 
+    EditBuffer *b;
+
     /* mode specific info */
-    struct ModeDef *mode;
+    ModeDef *mode;
     void *mode_data; /* mode private data */
 
-    EditBuffer *b;
-
     /* state before line n, one short per line */
     unsigned short *colorize_states;
     int colorize_nb_lines;
@@ -1202,22 +1206,22 @@
 #define WF_MODELINE   0x0002 /* mode line must be displayed */
 #define WF_RSEPARATOR 0x0004 /* right window separator */
 
-    char *prompt;
+    OWNED char *prompt;  /* optional window prompt, utf8, owned by the window 
*/
     //const char *mode_line;
     //const char *title;
     struct QEmacsState *qe_state;
     struct QEditScreen *screen; /* copy of qe_state->screen */
     /* display shadow to optimize redraw */
     char modeline_shadow[MAX_SCREEN_WIDTH];
-    QELineShadow *line_shadow; /* per window shadow */
+    OWNED QELineShadow *line_shadow; /* per window shadow */
     int shadow_nb_lines;
     /* compose state for input method */
-    struct InputMethod *input_method; /* current input method */
-    struct InputMethod *selected_input_method; /* selected input method (used 
to switch) */
+    InputMethod *input_method; /* current input method */
+    InputMethod *selected_input_method; /* selected input method (used to 
switch) */
     int compose_len;
     int compose_start_offset;
     unsigned int compose_buf[20];
-    EditState *next_window;
+    OWNED EditState *next_window;
 };
 
 /* Ugly patch for saving/restoring window data upon switching buffer */
@@ -1264,7 +1268,7 @@
     int instance_size; /* size of malloced instance */
 
     /* return the percentage of confidence */
-    int (*mode_probe)(ModeDef *, ModeProbeData *);
+    int (*mode_probe)(ModeDef *m, ModeProbeData *pd);
     int (*mode_init)(EditState *s, EditBuffer *b, int flags);
     void (*mode_close)(EditState *s);
 
@@ -1374,7 +1378,7 @@
     //struct QECharset *first_charset;
     //struct QETimer *first_timer;
     struct VarDef *first_variable;
-    struct InputMethod *input_methods;
+    InputMethod *input_methods;
     EditState *first_window;
     EditState *active_window; /* window in which we edit */
     EditBuffer *first_buffer;
@@ -1667,7 +1671,7 @@
 #define INPUTMETHOD_NOMATCH   (-1)
 #define INPUTMETHOD_MORECHARS (-2)
 
-typedef struct InputMethod {
+struct InputMethod {
     const char *name;
     /* input match returns:
        n > 0: number of code points in replacement found for a sequence
@@ -1681,8 +1685,8 @@
                        int *match_len_ptr, const u8 *data,
                        const unsigned int *buf, int len);
     const u8 *data;
-    struct InputMethod *next;
-} InputMethod;
+    InputMethod *next;
+};
 
 void register_input_method(InputMethod *m);
 void do_set_input_method(EditState *s, const char *method);

Index: search.c
===================================================================
RCS file: /sources/qemacs/qemacs/search.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- search.c    17 Aug 2015 16:56:49 -0000      1.1
+++ search.c    19 Aug 2015 16:22:30 -0000      1.2
@@ -164,7 +164,7 @@
     return is_user_input_pending();
 }
 
-typedef struct ISearchState {
+struct ISearchState {
     EditState *s;
     int saved_mark;
     int start_offset;
@@ -175,7 +175,7 @@
     int search_flags;
     int found_offset, found_end;
     unsigned int search_u32[SEARCH_LENGTH];
-} ISearchState;
+};
 
 static void buf_encode_search_u32(buf_t *out, const unsigned int *str, int len)
 {



reply via email to

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