qemacs-commit
[Top][All Lists]
Advanced

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

[Qemacs-commit] qemacs display.h tty.c cfb.c html2png.c win32.c...


From: Charlie Gordon
Subject: [Qemacs-commit] qemacs display.h tty.c cfb.c html2png.c win32.c...
Date: Tue, 17 Dec 2013 16:06:36 +0000

CVSROOT:        /sources/qemacs
Module name:    qemacs
Changes by:     Charlie Gordon <chqrlie>        13/12/17 16:06:36

Modified files:
        .              : display.h tty.c cfb.c html2png.c win32.c qe.h 
                         x11.c 

Log message:
        fix for C++ compile (needed for Haiku)
        
        renamed private structure members to priv_data
        added casts on assignents from void* (OK in C, not in C++)

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemacs/display.h?cvsroot=qemacs&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/qemacs/tty.c?cvsroot=qemacs&r1=1.50&r2=1.51
http://cvs.savannah.gnu.org/viewcvs/qemacs/cfb.c?cvsroot=qemacs&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/qemacs/html2png.c?cvsroot=qemacs&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/qemacs/win32.c?cvsroot=qemacs&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/qemacs/qe.h?cvsroot=qemacs&r1=1.99&r2=1.100
http://cvs.savannah.gnu.org/viewcvs/qemacs/x11.c?cvsroot=qemacs&r1=1.28&r2=1.29

Patches:
Index: display.h
===================================================================
RCS file: /sources/qemacs/qemacs/display.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- display.h   11 Jan 2008 11:29:28 -0000      1.11
+++ display.h   17 Dec 2013 16:06:35 -0000      1.12
@@ -53,7 +53,7 @@
     int refcount;
     int ascent;
     int descent;
-    void *private;
+    void *priv_data;
     int system_font; /* TRUE if system font */
     /* cache data */
     int style;
@@ -148,12 +148,12 @@
     QECharset *charset; /* the charset of the TTY, XXX: suppress that,
                           use a system in fonts instead */
     int media; /* media type (see CSS_MEDIA_xxx) */
-    int bitmap_format; /* supported bitmap format */
-    int video_format; /* supported video format */
+    QEBitmapFormat bitmap_format; /* supported bitmap format */
+    QEBitmapFormat video_format; /* supported video format */
     /* clip region handling */
     int clip_x1, clip_y1;
     int clip_x2, clip_y2;
-    void *private;
+    void *priv_data;
 };
 
 int qe_register_display(QEDisplay *dpy);

Index: tty.c
===================================================================
RCS file: /sources/qemacs/qemacs/tty.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -b -r1.50 -r1.51
--- tty.c       23 Apr 2008 15:30:33 -0000      1.50
+++ tty.c       17 Dec 2013 16:06:35 -0000      1.51
@@ -2,7 +2,7 @@
  * TTY handling for QEmacs
  *
  * Copyright (c) 2000,2001 Fabrice Bellard.
- * Copyright (c) 2002-2008 Charlie Gordon.
+ * Copyright (c) 2002-2013 Charlie Gordon.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -118,7 +118,7 @@
 
     tty_screen = s;
     ts = &tty_state;
-    s->private = ts;
+    s->priv_data = ts;
     s->media = CSS_MEDIA_TTY;
 
     /* Derive some settings from the TERM environment variable */
@@ -263,7 +263,7 @@
 static void tty_term_exit(void)
 {
     QEditScreen *s = tty_screen;
-    TTYState *ts = s->private;
+    TTYState *ts = s->priv_data;
 
     tcsetattr(fileno(s->STDIN), TCSANOW, &ts->oldtty);
 }
@@ -271,7 +271,7 @@
 static void tty_resize(__unused__ int sig)
 {
     QEditScreen *s = tty_screen;
-    TTYState *ts = s->private;
+    TTYState *ts = s->priv_data;
     struct winsize ws;
     int i, count, size;
     TTYChar tc;
@@ -318,7 +318,7 @@
 static void tty_term_cursor_at(QEditScreen *s, int x1, int y1,
                                __unused__ int w, __unused__ int h)
 {
-    TTYState *ts = s->private;
+    TTYState *ts = s->priv_data;
     ts->cursor_x = x1;
     ts->cursor_y = y1;
 }
@@ -380,7 +380,7 @@
 {
     QEditScreen *s = opaque;
     QEmacsState *qs = &qe_state;
-    TTYState *ts = s->private;
+    TTYState *ts = s->priv_data;
     int ch;
     QEEvent ev1, *ev = &ev1;
 
@@ -425,6 +425,7 @@
             ts->input_param = 0;
         } else if (ch == 'O') {
             ts->input_state = IS_ESC2;
+            ts->input_param = 0;
         } else {
             ch = KEY_META(ch);
             ts->input_state = IS_NORM;
@@ -826,7 +827,7 @@
 static void tty_term_fill_rectangle(QEditScreen *s,
                                     int x1, int y1, int w, int h, QEColor 
color)
 {
-    TTYState *ts = s->private;
+    TTYState *ts = s->priv_data;
     int x2 = x1 + w;
     int y2 = y1 + h;
     int x, y;
@@ -869,7 +870,7 @@
 
     font->ascent = 0;
     font->descent = 1;
-    font->private = NULL;
+    font->priv_data = NULL;
     return font;
 }
 
@@ -958,7 +959,7 @@
                                int x, int y, const unsigned int *str, int len,
                                QEColor color)
 {
-    TTYState *ts = s->private;
+    TTYState *ts = s->priv_data;
     TTYChar *ptr;
     int fgcolor, w, n;
     unsigned int cc;
@@ -1021,7 +1022,7 @@
 
 static void tty_term_flush(QEditScreen *s)
 {
-    TTYState *ts = s->private;
+    TTYState *ts = s->priv_data;
     TTYChar *ptr, *ptr1, *ptr2, *ptr3, *ptr4, cc, blankcc;
     int y, shadow, ch, bgcolor, fgcolor, shifted;
 

Index: cfb.c
===================================================================
RCS file: /sources/qemacs/qemacs/cfb.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- cfb.c       8 Apr 2008 06:55:44 -0000       1.8
+++ cfb.c       17 Dec 2013 16:06:35 -0000      1.9
@@ -50,7 +50,7 @@
 static void cfb16_fill_rectangle(QEditScreen *s,
                                  int x1, int y1, int w, int h, QEColor color)
 {
-    CFBContext *cfb = s->private;
+    CFBContext *cfb = s->priv_data;
     unsigned char *dest, *d;
     int y, n;
     unsigned int col;
@@ -101,7 +101,7 @@
 static void cfb32_fill_rectangle(QEditScreen *s,
                                  int x1, int y1, int w, int h, QEColor color)
 {
-    CFBContext *cfb = s->private;
+    CFBContext *cfb = s->priv_data;
     unsigned char *dest, *d;
     int y, n;
     unsigned int col;
@@ -145,7 +145,7 @@
                              int x1, int y1, int w, int h, QEColor color,
                              unsigned char *glyph, int glyph_wrap)
 {
-    CFBContext *cfb = s1->private;
+    CFBContext *cfb = s1->priv_data;
     unsigned char *dest, *d, *s, *src;
     int n;
     unsigned int col;
@@ -189,7 +189,7 @@
                              int x1, int y1, int w, int h, QEColor color,
                              unsigned char *glyph, int glyph_wrap)
 {
-    CFBContext *cfb = s1->private;
+    CFBContext *cfb = s1->priv_data;
     unsigned char *dest, *d, *s, *src;
     int n;
     unsigned int col;
@@ -233,7 +233,7 @@
                           int x_start, int y, const unsigned int *str, int len,
                           QEColor color)
 {
-    CFBContext *cfb = s->private;
+    CFBContext *cfb = s->priv_data;
     GlyphCache *g;
     unsigned char *glyph_ptr;
     int i, x1, y1, x2, y2, wrap, x;
@@ -309,7 +309,7 @@
 int cfb_init(QEditScreen *s,
              void *base, int wrap, int depth, const char *font_path)
 {
-    CFBContext *cfb = s->private;
+    CFBContext *cfb = s->priv_data;
 
     cfb->base = base;
     cfb->wrap = wrap;

Index: html2png.c
===================================================================
RCS file: /sources/qemacs/qemacs/html2png.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- html2png.c  11 Jan 2008 11:29:28 -0000      1.12
+++ html2png.c  17 Dec 2013 16:06:36 -0000      1.13
@@ -135,7 +135,7 @@
 /* realloc ppm bitmap */
 static int ppm_resize(QEditScreen *s, int w, int h)
 {
-    CFBContext *cfb = s->private;
+    CFBContext *cfb = s->priv_data;
 
     /* alloc bitmap */
     if (!qe_realloc(&cfb->base, w * h * sizeof(int))) {
@@ -160,7 +160,7 @@
     if (!cfb)
         return -1;
 
-    s->private = cfb;
+    s->priv_data = cfb;
     s->media = CSS_MEDIA_SCREEN;
 
     if (cfb_init(s, NULL, w * sizeof(int), 32, ".") < 0)
@@ -169,7 +169,7 @@
     if (ppm_resize(s, w, h) < 0) {
     fail:
         qe_free(&cfb->base);
-        qe_free(&s->private);
+        qe_free(&s->priv_data);
         return -1;
     }
     return 0;
@@ -177,15 +177,15 @@
 
 static void ppm_close(QEditScreen *s)
 {
-    CFBContext *cfb = s->private;
+    CFBContext *cfb = s->priv_data;
 
     qe_free(&cfb->base);
-    qe_free(&s->private);
+    qe_free(&s->priv_data);
 }
 
 static int ppm_save(QEditScreen *s, const char *filename)
 {
-    CFBContext *cfb = s->private;
+    CFBContext *cfb = s->priv_data;
     int w, h, x, y;
     unsigned int r, g, b, v;
     unsigned int *data;
@@ -219,7 +219,7 @@
 
 static int png_save(QEditScreen *s, const char *filename)
 {
-    CFBContext *cfb = s->private;
+    CFBContext *cfb = s->priv_data;
     struct png_save_data {
         FILE *f;
         png_structp png_ptr;

Index: win32.c
===================================================================
RCS file: /sources/qemacs/qemacs/win32.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- win32.c     23 Apr 2008 15:29:35 -0000      1.15
+++ win32.c     17 Dec 2013 16:06:36 -0000      1.16
@@ -139,7 +139,7 @@
     if (!_hPrev)
         init_application();
 
-    s->private = NULL;
+    s->priv_data = NULL;
     s->media = CSS_MEDIA_SCREEN;
 
     win_ctx.font = CreateFont(-12, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0,
@@ -452,7 +452,7 @@
     GetTextMetrics(win_ctx.hdc, &tm);
     font->ascent = tm.tmAscent;
     font->descent = tm.tmDescent;
-    font->private = NULL;
+    font->priv_data = NULL;
     return font;
 }
 

Index: qe.h
===================================================================
RCS file: /sources/qemacs/qemacs/qe.h,v
retrieving revision 1.99
retrieving revision 1.100
diff -u -b -r1.99 -r1.100
--- qe.h        3 Dec 2013 17:35:06 -0000       1.99
+++ qe.h        17 Dec 2013 16:06:36 -0000      1.100
@@ -272,11 +272,11 @@
 int ustristart(const unsigned int *str, const char *val, const unsigned int 
**ptr);
 static inline unsigned int *umemmove(unsigned int *dest,
                                      unsigned int *src, int count) {
-    return memmove(dest, src, count * sizeof(unsigned int));
+    return (unsigned int *)memmove(dest, src, count * sizeof(unsigned int));
 }
 static inline unsigned int *umemcpy(unsigned int *dest,
                                     unsigned int *src, int count) {
-    return memcpy(dest, src, count * sizeof(unsigned int));
+    return (unsigned int *)memcpy(dest, src, count * sizeof(unsigned int));
 }
 int umemcmp(const unsigned int *s1, const unsigned int *s2, int count);
 

Index: x11.c
===================================================================
RCS file: /sources/qemacs/qemacs/x11.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -b -r1.28 -r1.29
--- x11.c       15 Apr 2008 23:24:04 -0000      1.28
+++ x11.c       17 Dec 2013 16:06:36 -0000      1.29
@@ -2,7 +2,7 @@
  * X11 handling for QEmacs
  *
  * Copyright (c) 2000, 2001, 2002, 2003 Fabrice Bellard.
- * Copyright (c) 2002-2008 Charlie Gordon.
+ * Copyright (c) 2002-2013 Charlie Gordon.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -194,7 +194,7 @@
     QEStyleDef default_style;
     XGCValues gc_val;
 
-    s->private = NULL;
+    s->priv_data = NULL;
     s->media = CSS_MEDIA_SCREEN;
 
     if (!display_str)
@@ -564,13 +564,13 @@
     }
     font->ascent = renderFont->ascent;
     font->descent = renderFont->descent;
-    font->private = renderFont;
+    font->priv_data = renderFont;
     return font;
 }
 
 static void term_close_font(QEditScreen *s, QEFont *font)
 {
-    XftFont *renderFont = font->private;
+    XftFont *renderFont = font->priv_data;
 
     XftFontClose(display, renderFont);
     /* Clear structure to force crash if font is still used after
@@ -582,7 +582,7 @@
 
 static int term_glyph_width(QEditScreen *s, QEFont *font, unsigned int cc)
 {
-    XftFont *renderFont = font->private;
+    XftFont *renderFont = font->priv_data;
     XGlyphInfo gi;
 
     XftTextExtents32(display, renderFont, &cc, 1, &gi);
@@ -593,7 +593,7 @@
                            int x, int y, const unsigned int *str, int len,
                            QEColor color)
 {
-    XftFont *renderFont = font->private;
+    XftFont *renderFont = font->priv_data;
     XftColor col;
     int r, g, b, a;
 
@@ -764,7 +764,7 @@
 
     font->ascent = xfont->ascent;
     font->descent = xfont->descent;
-    font->private = xfont;
+    font->priv_data = xfont;
     return font;
  fail:
     XFreeFontNames(list);
@@ -774,7 +774,7 @@
 
 static void term_close_font(__unused__ QEditScreen *s, QEFont *font)
 {
-    XFontStruct *xfont = font->private;
+    XFontStruct *xfont = font->priv_data;
 
     XFreeFont(display, xfont);
     /* Clear structure to force crash if font is still used after
@@ -788,7 +788,7 @@
    associated. */
 static XCharStruct *get_char_struct(QEFont *font, int cc)
 {
-    XFontStruct *xfont = font->private;
+    XFontStruct *xfont = font->priv_data;
     int b1, b2;
     XCharStruct *cs;
 
@@ -856,7 +856,7 @@
 
     /* really no glyph : use default char in current font */
     /* Should have half-width and full-width default char patterns */
-    xfont = font->private;
+    xfont = font->priv_data;
     cs = get_char_struct(font, xfont->default_char);
     *out_font = lock_font(s, font);
     return cs;
@@ -928,13 +928,13 @@
             cs = handle_fallback(s, &font1, font, cc);
             if (!cs) {
                 /* still no char: use default glyph */
-                xfont = font->private;
+                xfont = font->priv_data;
                 cc = xfont->default_char;
             }
         }
         /* flush previous chars if font change needed */
         if (font1 != last_font && q > x11_str) {
-            xfont = last_font->private;
+            xfont = last_font->priv_data;
             l = q - x11_str;
             XSetFont(display, gc, xfont->fid);
             XDrawString16(display, dbuffer, gc, x_start, y, x11_str, l);
@@ -950,7 +950,7 @@
     }
     if (q > x11_str) {
         /* flush remaining chars (more common case) */
-        xfont = last_font->private;
+        xfont = last_font->priv_data;
         l = q - x11_str;
         XSetFont(display, gc, xfont->fid);
         XDrawString16(display, dbuffer, gc, x_start, y, x11_str, l);



reply via email to

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