Skip to content

Commit 5c9ba4b

Browse files
author
runge
committed
still more compiler warnings; ssvnc 1.0.9 sync.
1 parent f9baaf1 commit 5c9ba4b

28 files changed

+424
-188
lines changed

x11vnc/8to24.c

+24-19
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,16 @@ static Colormap root_cmap = 0;
6565
static unsigned int root_rgb[NCOLOR];
6666

6767
static void set_root_cmap(void) {
68+
#if NO_X11
69+
return;
70+
#else
6871
static time_t last_set = 0;
6972
time_t now = time(NULL);
7073
XWindowAttributes attr;
7174
static XColor color[NCOLOR];
7275
int redo = 0;
7376

7477
RAWFB_RET_VOID
75-
#if NO_X11
76-
return;
77-
#else
7878

7979
if (now > last_set + 10) {
8080
redo = 1;
@@ -244,6 +244,9 @@ int MV_hit;
244244
double MV_start;
245245

246246
void check_for_multivis(void) {
247+
#if NO_X11
248+
return;
249+
#else
247250
XWindowAttributes attr;
248251
int doall = 0;
249252
int k, i, cnt, diff;
@@ -261,9 +264,6 @@ void check_for_multivis(void) {
261264
double delay;
262265

263266
RAWFB_RET_VOID
264-
#if NO_X11
265-
return;
266-
#else
267267

268268
if (now > last_parse + 1.0) {
269269
last_parse = now;
@@ -758,10 +758,11 @@ if (db24 > 1) fprintf(stderr, " ------------ 0x%lx i=%d\n", windows_8bp
758758
}
759759

760760
static XImage *p_xi(XImage *xi, Visual *visual, int win_depth, int *w) {
761-
RAWFB_RET(NULL)
762761
#if NO_X11
762+
if (!xi || !visual || !win_depth || !w) {}
763763
return NULL;
764764
#else
765+
RAWFB_RET(NULL)
765766
if (xi == NULL || *w < dpy_x) {
766767
char *d;
767768
if (xi) {
@@ -781,6 +782,10 @@ static XImage *p_xi(XImage *xi, Visual *visual, int win_depth, int *w) {
781782
}
782783

783784
static int poll_line(int x1, int x2, int y1, int n, sraRegionPtr mod) {
785+
#if NO_X11
786+
if (!x1 || !x2 || !y1 || !n || !mod) {}
787+
return 1;
788+
#else
784789
int fac, n_off, w, xo, yo;
785790
char *poll_fb, *dst, *src;
786791
int w2, xl, xh, stride = 32;
@@ -804,9 +809,6 @@ static int poll_line(int x1, int x2, int y1, int n, sraRegionPtr mod) {
804809

805810
RAWFB_RET(1)
806811

807-
#if NO_X11
808-
return 1;
809-
#else
810812
if (win == None) {
811813
return 1;
812814
}
@@ -1292,13 +1294,14 @@ static int cmap_failed[CMAPMAX];
12921294
int histo[256];
12931295

12941296
static int get_cmap(int j, Colormap cmap) {
1297+
#if NO_X11
1298+
if (!j || !cmap) {}
1299+
return 0;
1300+
#else
12951301
int i, ncells;
12961302
XErrorHandler old_handler = NULL;
12971303

12981304
RAWFB_RET(0)
1299-
#if NO_X11
1300-
return 0;
1301-
#else
13021305

13031306
if (0) {
13041307
/* not working properly for depth 24... */
@@ -1427,12 +1430,13 @@ if (db24 > 1) fprintf(stderr, "ncmaps: %d\n", ncmaps);
14271430
}
14281431

14291432
static XImage *cmap_xi(XImage *xi, Window win, int win_depth) {
1430-
XWindowAttributes attr;
1431-
char *d;
1432-
14331433
#if NO_X11
1434+
if (!xi || !win || !win_depth) {}
14341435
return NULL;
14351436
#else
1437+
XWindowAttributes attr;
1438+
char *d;
1439+
14361440
if (xi) {
14371441
XDestroyImage(xi);
14381442
}
@@ -1455,6 +1459,10 @@ static XImage *cmap_xi(XImage *xi, Window win, int win_depth) {
14551459

14561460

14571461
static void transform_rect(sraRect rect, Window win, int win_depth, int cm) {
1462+
#if NO_X11
1463+
if (!rect.x1 || !win || !win_depth || !cm) {}
1464+
return;
1465+
#else
14581466

14591467
char *src, *dst, *poll;
14601468
unsigned int *ui;
@@ -1471,9 +1479,6 @@ static void transform_rect(sraRect rect, Window win, int win_depth, int cm) {
14711479
if (db24 > 1) fprintf(stderr, "transform %4d %4d %4d %4d cm: %d\n", rect.x1, rect.y1, rect.x2, rect.y2, cm);
14721480

14731481
RAWFB_RET_VOID
1474-
#if NO_X11
1475-
return;
1476-
#else
14771482

14781483
attr.width = 0;
14791484
attr.height = 0;

x11vnc/README

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
x11vnc README file Date: Thu Dec 28 12:53:07 EST 2006
2+
x11vnc README file Date: Thu Dec 28 14:49:09 EST 2006
33

44
The following information is taken from these URLs:
55

x11vnc/connections.c

+21-10
Original file line numberDiff line numberDiff line change
@@ -908,6 +908,12 @@ static int check_access(char *addr) {
908908
*/
909909
static int ugly_window(char *addr, char *userhost, int X, int Y,
910910
int timeout, char *mode, int accept) {
911+
#if NO_X11
912+
if (!addr || !userhost || !X || !Y || !timeout || !mode || !accept) {}
913+
RAWFB_RET(0)
914+
nox11_exit(1);
915+
return 0;
916+
#else
911917

912918
#define t2x2_width 16
913919
#define t2x2_height 16
@@ -961,10 +967,6 @@ static unsigned char t2x2_bits[] = {
961967
KeyCode key_o;
962968

963969
RAWFB_RET(0)
964-
#if NO_X11
965-
nox11_exit(1);
966-
return 0;
967-
#else
968970

969971
if (! accept) {
970972
sprintf(str_y, "OK");
@@ -1740,6 +1742,8 @@ void set_vnc_connect_prop(char *str) {
17401742
#if !NO_X11
17411743
XChangeProperty(dpy, rootwin, vnc_connect_prop, XA_STRING, 8,
17421744
PropModeReplace, (unsigned char *)str, strlen(str));
1745+
#else
1746+
if (!str) {}
17431747
#endif /* NO_X11 */
17441748
}
17451749

@@ -1748,10 +1752,17 @@ void set_x11vnc_remote_prop(char *str) {
17481752
#if !NO_X11
17491753
XChangeProperty(dpy, rootwin, x11vnc_remote_prop, XA_STRING, 8,
17501754
PropModeReplace, (unsigned char *)str, strlen(str));
1755+
#else
1756+
if (!str) {}
17511757
#endif /* NO_X11 */
17521758
}
17531759

17541760
void read_vnc_connect_prop(int nomsg) {
1761+
#if NO_X11
1762+
RAWFB_RET_VOID
1763+
if (!nomsg) {}
1764+
return;
1765+
#else
17551766
Atom type;
17561767
int format, slen, dlen;
17571768
unsigned long nitems = 0, bytes_after = 0;
@@ -1766,9 +1777,6 @@ void read_vnc_connect_prop(int nomsg) {
17661777
return;
17671778
}
17681779
RAWFB_RET_VOID
1769-
#if NO_X11
1770-
return;
1771-
#else
17721780

17731781
/* read the property value into vnc_connect_str: */
17741782
do {
@@ -1802,6 +1810,11 @@ void read_vnc_connect_prop(int nomsg) {
18021810
}
18031811

18041812
void read_x11vnc_remote_prop(int nomsg) {
1813+
#if NO_X11
1814+
RAWFB_RET_VOID
1815+
if (!nomsg) {}
1816+
return;
1817+
#else
18051818
Atom type;
18061819
int format, slen, dlen;
18071820
unsigned long nitems = 0, bytes_after = 0;
@@ -1816,9 +1829,6 @@ void read_x11vnc_remote_prop(int nomsg) {
18161829
return;
18171830
}
18181831
RAWFB_RET_VOID
1819-
#if NO_X11
1820-
return;
1821-
#else
18221832

18231833
/* read the property value into x11vnc_remote_str: */
18241834
do {
@@ -2293,6 +2303,7 @@ void send_client_info(char *str) {
22932303
void adjust_grabs(int grab, int quiet) {
22942304
RAWFB_RET_VOID
22952305
#if NO_X11
2306+
if (!grab || !quiet) {}
22962307
return;
22972308
#else
22982309
/* n.b. caller decides to X_LOCK or not. */

x11vnc/cursor.c

+9-3
Original file line numberDiff line numberDiff line change
@@ -837,6 +837,11 @@ void setup_cursors_and_push(void) {
837837
*
838838
*/
839839
static void tree_descend_cursor(int *depth, Window *w, win_str_info_t *winfo) {
840+
#if NO_X11
841+
RAWFB_RET_VOID
842+
if (!depth || !w || !winfo) {}
843+
return;
844+
#else
840845
Window r, c;
841846
int i, rx, ry, wx, wy;
842847
unsigned int mask;
@@ -848,9 +853,6 @@ static void tree_descend_cursor(int *depth, Window *w, win_str_info_t *winfo) {
848853
XErrorHandler old_handler;
849854

850855
RAWFB_RET_VOID
851-
#if NO_X11
852-
return;
853-
#else
854856

855857
X_LOCK;
856858

@@ -1540,6 +1542,8 @@ int get_which_cursor(void) {
15401542
XSetErrorHandler(old_handler);
15411543
X_UNLOCK;
15421544
trapped_xerror = 0;
1545+
#else
1546+
if (!r || !d || !bw || !h || !w || !y || !x || !ratio || !old_handler) {}
15431547
#endif /* NO_X11 */
15441548
}
15451549
if (which == which0) {
@@ -1895,6 +1899,8 @@ int check_x11_pointer(void) {
18951899
&win_x, &win_y, &mask);
18961900
X_UNLOCK;
18971901
}
1902+
#else
1903+
if (!mask || !win_y || !win_x || !child_w || !root_w) {}
18981904
#endif /* NO_X11 */
18991905

19001906
if (0) fprintf(stderr, "check_x11_pointer %d %d\n", root_x, root_y);

x11vnc/gui.c

+14-9
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,13 @@ char *get_gui_code(void) {
4343
}
4444

4545
static Window tweak_tk_window_id(Window win) {
46-
char *name = NULL;
47-
Window parent, new;
48-
4946
#if NO_X11
47+
if (!win) {}
5048
return None;
5149
#else
50+
char *name = NULL;
51+
Window parent, new;
52+
5253
/* hack for tk, does not report outermost window */
5354
new = win;
5455
parent = parent_window(win, &name);
@@ -67,6 +68,11 @@ static Window tweak_tk_window_id(Window win) {
6768
}
6869

6970
int tray_embed(Window iconwin, int remove) {
71+
#if NO_X11
72+
RAWFB_RET(0)
73+
if (!iconwin || !remove) {}
74+
return 0;
75+
#else
7076
XEvent ev;
7177
XErrorHandler old_handler;
7278
Window manager;
@@ -77,9 +83,6 @@ int tray_embed(Window iconwin, int remove) {
7783
long data = 0;
7884

7985
RAWFB_RET(0)
80-
#if NO_X11
81-
return 0;
82-
#else
8386

8487
if (remove) {
8588
if (!valid_window(iconwin, &attr, 1)) {
@@ -164,14 +167,16 @@ int tray_embed(Window iconwin, int remove) {
164167
}
165168

166169
static int tray_manager_running(Display *d, Window *manager) {
170+
#if NO_X11
171+
RAWFB_RET(0)
172+
if (!d || !manager) {}
173+
return 0;
174+
#else
167175
char tray_string[100];
168176
Atom tray_manager;
169177
Window tray_win;
170178

171179
RAWFB_RET(0)
172-
#if NO_X11
173-
return 0;
174-
#else
175180

176181
if (manager) {
177182
*manager = None;

0 commit comments

Comments
 (0)