Commit f9baaf1e authored by runge's avatar runge

more compiler warnings cleanup.

parent 99a557d6
...@@ -1475,6 +1475,9 @@ if (db24 > 1) fprintf(stderr, "transform %4d %4d %4d %4d cm: %d\n", rect.x1, rec ...@@ -1475,6 +1475,9 @@ if (db24 > 1) fprintf(stderr, "transform %4d %4d %4d %4d cm: %d\n", rect.x1, rec
return; return;
#else #else
attr.width = 0;
attr.height = 0;
/* now transform the pixels in this rectangle: */ /* now transform the pixels in this rectangle: */
n_off = main_bytes_per_line * rect.y1 + pixelsize * rect.x1; n_off = main_bytes_per_line * rect.y1 + pixelsize * rect.x1;
......
x11vnc README file Date: Thu Dec 28 10:42:34 EST 2006 x11vnc README file Date: Thu Dec 28 12:53:07 EST 2006
The following information is taken from these URLs: The following information is taken from these URLs:
......
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
#include "sslcmds.h" #include "sslcmds.h"
#include "sslhelper.h" #include "sslhelper.h"
#include "connections.h" #include "connections.h"
#include "macosx.h"
#include "macosxCG.h"
/* /*
* Exiting and error handling routines * Exiting and error handling routines
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include "sslhelper.h" #include "sslhelper.h"
#include "xwrappers.h" #include "xwrappers.h"
#include "xevents.h" #include "xevents.h"
#include "macosx.h"
#include "macosxCG.h" #include "macosxCG.h"
#include "userinput.h" #include "userinput.h"
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include "screen.h" #include "screen.h"
#include "scan.h" #include "scan.h"
#include "unixpw.h" #include "unixpw.h"
#include "macosx.h"
int xfixes_present = 0; int xfixes_present = 0;
int use_xfixes = 1; int use_xfixes = 1;
...@@ -1460,10 +1461,10 @@ int get_which_cursor(void) { ...@@ -1460,10 +1461,10 @@ int get_which_cursor(void) {
int db = 0; int db = 0;
if (show_multiple_cursors) { if (show_multiple_cursors) {
int depth; int depth = 0;
static win_str_info_t winfo; static win_str_info_t winfo;
static int first = 1, depth_cutoff = -1; static int first = 1, depth_cutoff = -1;
Window win; Window win = None;
XErrorHandler old_handler; XErrorHandler old_handler;
int mode = 0; int mode = 0;
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "allowed_input_t.h" #include "allowed_input_t.h"
#include "keyboard.h" #include "keyboard.h"
#include "cursor.h" #include "cursor.h"
#include "connections.h"
#include "macosxCG.h" #include "macosxCG.h"
#include "macosxCGP.h" #include "macosxCGP.h"
#include "macosxCGS.h" #include "macosxCGS.h"
...@@ -35,6 +36,8 @@ int macosx_valid_window(Window, XWindowAttributes*); ...@@ -35,6 +36,8 @@ int macosx_valid_window(Window, XWindowAttributes*);
Status macosx_xquerytree(Window w, Window *root_return, Window *parent_return, Status macosx_xquerytree(Window w, Window *root_return, Window *parent_return,
Window **children_return, unsigned int *nchildren_return); Window **children_return, unsigned int *nchildren_return);
int macosx_get_wm_frame_pos(int *px, int *py, int *x, int *y, int *w, int *h,
Window *frame, Window *win);
void macosx_add_mapnotify(Window win, int level, int map); void macosx_add_mapnotify(Window win, int level, int map);
void macosx_add_create(Window win, int level); void macosx_add_create(Window win, int level);
...@@ -287,7 +290,6 @@ void init_key_table(void) { ...@@ -287,7 +290,6 @@ void init_key_table(void) {
} }
void macosx_key_command(rfbBool down, rfbKeySym keysym, rfbClientPtr client) { void macosx_key_command(rfbBool down, rfbKeySym keysym, rfbClientPtr client) {
static int control = 0, alt = 0;
allowed_input_t input; allowed_input_t input;
if (debug_keyboard) fprintf(stderr, "macosx_key_command: %d %s\n", (int) keysym, down ? "down" : "up"); if (debug_keyboard) fprintf(stderr, "macosx_key_command: %d %s\n", (int) keysym, down ? "down" : "up");
...@@ -301,7 +303,6 @@ void macosx_key_command(rfbBool down, rfbKeySym keysym, rfbClientPtr client) { ...@@ -301,7 +303,6 @@ void macosx_key_command(rfbBool down, rfbKeySym keysym, rfbClientPtr client) {
init_key_table(); init_key_table();
macosxCG_key_inject((int) down, (unsigned int) keysym); macosxCG_key_inject((int) down, (unsigned int) keysym);
} }
extern void macosxGCS_poll_pb(void); extern void macosxGCS_poll_pb(void);
...@@ -600,11 +601,11 @@ extern int CGS_levels[]; ...@@ -600,11 +601,11 @@ extern int CGS_levels[];
Status macosx_xquerytree(Window w, Window *root_return, Window *parent_return, Status macosx_xquerytree(Window w, Window *root_return, Window *parent_return,
Window **children_return, unsigned int *nchildren_return) { Window **children_return, unsigned int *nchildren_return) {
int i, n, k, swap; int i, n, k;
int win1, win2;
*root_return = (Window) 0; *root_return = (Window) 0;
*parent_return = (Window) 0; *parent_return = (Window) 0;
if (!w) {}
macosxCGS_get_all_windows(); macosxCGS_get_all_windows();
...@@ -685,17 +686,13 @@ int macosx_check_clipped(int win, int *list, int n) { ...@@ -685,17 +686,13 @@ int macosx_check_clipped(int win, int *list, int n) {
if (sraRgnAnd(r2, r1)) { if (sraRgnAnd(r2, r1)) {
ret = 1; ret = 1;
sraRgnDestroy(r2); sraRgnDestroy(r2);
//fprintf(stderr, "macosx_check_clipped: %4d %4d -- CLIP\n", win, list[k]);
break; break;
} }
//fprintf(stderr, "macosx_check_clipped: %4d %4d -- -no-\n", win, list[k]);
sraRgnDestroy(r2); sraRgnDestroy(r2);
} }
sraRgnDestroy(r0); sraRgnDestroy(r0);
sraRgnDestroy(r1); sraRgnDestroy(r1);
//fprintf(stderr, "macosx_check_clipped: %4d -- CLIP: %s\n", win, ret ? "yes" : "no");
return ret; return ret;
} }
......
...@@ -13,6 +13,8 @@ extern int macosx_get_cursor_pos(int *, int *); ...@@ -13,6 +13,8 @@ extern int macosx_get_cursor_pos(int *, int *);
extern int macosx_valid_window(Window, XWindowAttributes*); extern int macosx_valid_window(Window, XWindowAttributes*);
extern Status macosx_xquerytree(Window w, Window *root_return, Window *parent_return, extern Status macosx_xquerytree(Window w, Window *root_return, Window *parent_return,
Window **children_return, unsigned int *nchildren_return); Window **children_return, unsigned int *nchildren_return);
extern int macosx_get_wm_frame_pos(int *px, int *py, int *x, int *y, int *w, int *h,
Window *frame, Window *win);
extern void macosx_send_sel(char *, int); extern void macosx_send_sel(char *, int);
extern void macosx_set_sel(char *, int); extern void macosx_set_sel(char *, int);
......
...@@ -15,6 +15,7 @@ void macosxCG_dummy(void) {} ...@@ -15,6 +15,7 @@ void macosxCG_dummy(void) {}
#include <Carbon/Carbon.h> #include <Carbon/Carbon.h>
void macosxCG_init(void); void macosxCG_init(void);
void macosxCG_fini(void);
void macosxCG_event_loop(void); void macosxCG_event_loop(void);
char *macosxCG_get_fb_addr(void); char *macosxCG_get_fb_addr(void);
...@@ -38,7 +39,8 @@ extern int collect_macosx_damage(int x_in, int y_in, int w_in, int h_in, int cal ...@@ -38,7 +39,8 @@ extern int collect_macosx_damage(int x_in, int y_in, int w_in, int h_in, int cal
static void macosxCG_callback(CGRectCount n, const CGRect *rects, void *dum) { static void macosxCG_callback(CGRectCount n, const CGRect *rects, void *dum) {
int i, db = 0; int i, db = 0;
if (db) fprintf(stderr, "macosx_callback: n=%d\n", (int) n); if (db) fprintf(stderr, "macosx_callback: n=%d\n", (int) n);
for (i=0; i < n; i++) { if (!dum) {}
for (i=0; i < (int) n; i++) {
if (db > 1) fprintf(stderr, " : %g %g - %g %g\n", rects[i].origin.x, rects[i].origin.y, rects[i].size.width, rects[i].size.height); if (db > 1) fprintf(stderr, " : %g %g - %g %g\n", rects[i].origin.x, rects[i].origin.y, rects[i].size.width, rects[i].size.height);
collect_macosx_damage( (int) rects[i].origin.x, (int) rects[i].origin.y, collect_macosx_damage( (int) rects[i].origin.x, (int) rects[i].origin.y,
(int) rects[i].size.width, (int) rects[i].size.height, 1); (int) rects[i].size.width, (int) rects[i].size.height, 1);
...@@ -90,6 +92,11 @@ void macosxCG_refresh_callback_off(void) { ...@@ -90,6 +92,11 @@ void macosxCG_refresh_callback_off(void) {
extern int macosx_noscreensaver; extern int macosx_noscreensaver;
extern void macosxGCS_initpb(void); extern void macosxGCS_initpb(void);
extern int macosxCGP_init_dimming(void);
extern int macosxCGP_undim(void);
extern int macosxCGP_dim_shutdown(void);
extern void macosxCGP_screensaver_timer_off(void);
extern void macosxCGP_screensaver_timer_on(void);
void macosxCG_init(void) { void macosxCG_init(void) {
if (displayID == NULL) { if (displayID == NULL) {
...@@ -130,6 +137,10 @@ extern int client_count, nofb; ...@@ -130,6 +137,10 @@ extern int client_count, nofb;
extern void do_new_fb(int); extern void do_new_fb(int);
extern int macosx_wait_for_switch, macosx_resize; extern int macosx_wait_for_switch, macosx_resize;
extern void macosxGCS_poll_pb(void);
extern void usleep(unsigned long usec);
extern unsigned int sleep(unsigned int seconds);
void macosxCG_event_loop(void) { void macosxCG_event_loop(void) {
OSStatus rc; OSStatus rc;
int nbpp; int nbpp;
...@@ -278,11 +289,11 @@ int macosxCG_get_cursor(void) { ...@@ -278,11 +289,11 @@ int macosxCG_get_cursor(void) {
int last_idx = (int) get_cursor_serial(1); int last_idx = (int) get_cursor_serial(1);
int which = 1; int which = 1;
CGError err; CGError err;
int datasize, masksize, row_bytes, cdepth, comps, bpcomp; int datasize, row_bytes, cdepth, comps, bpcomp;
CGRect rect; CGRect rect;
CGPoint hot; CGPoint hot;
unsigned char *data; unsigned char *data;
int res, cursor_seed; int cursor_seed;
static int last_cursor_seed = -1; static int last_cursor_seed = -1;
static time_t last_fetch = 0; static time_t last_fetch = 0;
time_t now = time(NULL); time_t now = time(NULL);
...@@ -337,7 +348,7 @@ extern int macosx_swap23; ...@@ -337,7 +348,7 @@ extern int macosx_swap23;
extern int off_x, coff_x, off_y, coff_y; extern int off_x, coff_x, off_y, coff_y;
void macosxCG_pointer_inject(int mask, int x, int y) { void macosxCG_pointer_inject(int mask, int x, int y) {
int swap23 = macosx_swap23, rc; int swap23 = macosx_swap23;
int s1 = 0, s2 = 1, s3 = 2, s4 = 3, s5 = 4; int s1 = 0, s2 = 1, s3 = 2, s4 = 3, s5 = 4;
CGPoint loc; CGPoint loc;
int wheel_distance = macosx_mouse_wheel_speed; int wheel_distance = macosx_mouse_wheel_speed;
...@@ -561,23 +572,25 @@ void macosxCG_init_key_table(void) { ...@@ -561,23 +572,25 @@ void macosxCG_init_key_table(void) {
keyTable[i] = 0xFFFF; keyTable[i] = 0xFFFF;
keyTableMods[i] = 0; keyTableMods[i] = 0;
} }
for (i=0; i< (sizeof(USKeyCodes) / sizeof(int)); i += 2) { for (i=0; i< (int) (sizeof(USKeyCodes) / sizeof(int)); i += 2) {
int j = USKeyCodes[i]; int j = USKeyCodes[i];
keyTable[(unsigned short) j] = (CGKeyCode) USKeyCodes[i+1]; keyTable[(unsigned short) j] = (CGKeyCode) USKeyCodes[i+1];
} }
for (i=0; i< (sizeof(SpecialKeyCodes) / sizeof(int)); i += 2) { for (i=0; i< (int) (sizeof(SpecialKeyCodes) / sizeof(int)); i += 2) {
int j = SpecialKeyCodes[i]; int j = SpecialKeyCodes[i];
keyTable[(unsigned short) j] = (CGKeyCode) SpecialKeyCodes[i+1]; keyTable[(unsigned short) j] = (CGKeyCode) SpecialKeyCodes[i+1];
} }
} }
void macosxCG_key_inject(int down, unsigned int keysym) { extern void init_key_table(void);
static int control = 0, alt = 0;
int pressModsForKeys = FALSE;
void macosxCG_key_inject(int down, unsigned int keysym) {
CGKeyCode keyCode = keyTable[(unsigned short)keysym]; CGKeyCode keyCode = keyTable[(unsigned short)keysym];
CGCharCode keyChar = 0; CGCharCode keyChar = 0;
#if 0
int pressModsForKeys = FALSE;
UInt32 modsForKey = keyTableMods[keysym] << 8; UInt32 modsForKey = keyTableMods[keysym] << 8;
#endif
init_key_table(); init_key_table();
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
/* -- macosxCG.h -- */ /* -- macosxCG.h -- */
extern void macosxCG_init(void); extern void macosxCG_init(void);
extern void macosxCG_fini(void);
extern void macosxCG_event_loop(void); extern void macosxCG_event_loop(void);
extern char *macosxCG_get_fb_addr(void); extern char *macosxCG_get_fb_addr(void);
...@@ -12,6 +13,7 @@ extern int macosxCG_CGDisplayPixelsHigh(void); ...@@ -12,6 +13,7 @@ extern int macosxCG_CGDisplayPixelsHigh(void);
extern int macosxCG_CGDisplayBitsPerPixel(void); extern int macosxCG_CGDisplayBitsPerPixel(void);
extern int macosxCG_CGDisplayBitsPerSample(void); extern int macosxCG_CGDisplayBitsPerSample(void);
extern int macosxCG_CGDisplaySamplesPerPixel(void); extern int macosxCG_CGDisplaySamplesPerPixel(void);
extern int macosxCG_CGDisplayBytesPerRow(void);
extern void macosxCG_pointer_inject(int mask, int x, int y); extern void macosxCG_pointer_inject(int mask, int x, int y);
extern int macosxCG_get_cursor_pos(int *x, int *y); extern int macosxCG_get_cursor_pos(int *x, int *y);
...@@ -19,5 +21,9 @@ extern int macosxCG_get_cursor(void); ...@@ -19,5 +21,9 @@ extern int macosxCG_get_cursor(void);
extern void macosxCG_init_key_table(void); extern void macosxCG_init_key_table(void);
extern void macosxCG_key_inject(int down, unsigned int keysym); extern void macosxCG_key_inject(int down, unsigned int keysym);
extern void macosxCG_refresh_callback_off(void);
extern void macosxCG_refresh_callback_on(void);
#endif /* _X11VNC_MACOSXCG_H */ #endif /* _X11VNC_MACOSXCG_H */
...@@ -38,21 +38,22 @@ static EventLoopTimerUPP sstimerUPP; ...@@ -38,21 +38,22 @@ static EventLoopTimerUPP sstimerUPP;
static EventLoopTimerRef sstimer; static EventLoopTimerRef sstimer;
void macosxCG_screensaver_timer(EventLoopTimerRef timer, void *data) { void macosxCG_screensaver_timer(EventLoopTimerRef timer, void *data) {
if (0) fprintf(stderr, "macosxCG_screensaver_timer: %d\n", time(0)); if (0) fprintf(stderr, "macosxCG_screensaver_timer: %d\n", (int) time(0));
if (!timer || !data) {}
if (macosx_nosleep && client_count) { if (macosx_nosleep && client_count) {
if (0) fprintf(stderr, "UpdateSystemActivity: %d\n", time(0)); if (0) fprintf(stderr, "UpdateSystemActivity: %d\n", (int) time(0));
UpdateSystemActivity(IdleActivity); UpdateSystemActivity(IdleActivity);
} }
} }
void macosxCGP_screensaver_timer_off(void) { void macosxCGP_screensaver_timer_off(void) {
if (0) fprintf(stderr, "macosxCGP_screensaver_timer_off: %d\n", time(0)); if (0) fprintf(stderr, "macosxCGP_screensaver_timer_off: %d\n", (int) time(0));
RemoveEventLoopTimer(sstimer); RemoveEventLoopTimer(sstimer);
DisposeEventLoopTimerUPP(sstimerUPP); DisposeEventLoopTimerUPP(sstimerUPP);
} }
void macosxCGP_screensaver_timer_on(void) { void macosxCGP_screensaver_timer_on(void) {
if (0) fprintf(stderr, "macosxCGP_screensaver_timer_on: %d\n", time(0)); if (0) fprintf(stderr, "macosxCGP_screensaver_timer_on: %d\n", (int) time(0));
sstimerUPP = NewEventLoopTimerUPP(macosxCG_screensaver_timer); sstimerUPP = NewEventLoopTimerUPP(macosxCG_screensaver_timer);
InstallEventLoopTimer(GetMainEventLoop(), kEventDurationSecond * 30, InstallEventLoopTimer(GetMainEventLoop(), kEventDurationSecond * 30,
kEventDurationSecond * 30, sstimerUPP, NULL, &sstimer); kEventDurationSecond * 30, sstimerUPP, NULL, &sstimer);
......
...@@ -132,11 +132,13 @@ int macosxCGS_find_index(int w) { ...@@ -132,11 +132,13 @@ int macosxCGS_find_index(int w) {
return -1; return -1;
} }
extern void usleep(unsigned long usec);
int macosxCGS_follow_animation_win(int win, int idx, int grow) { int macosxCGS_follow_animation_win(int win, int idx, int grow) {
double t = dnow(); double t = dnow();
int diffs = 0; int diffs = 0;
int x, y, w, h; int x, y, w, h;
int xp, yp, wp, hp; int xp = -1, yp = -1, wp = -1, hp = -1;
CGSRect rect; CGSRect rect;
CGSError err; CGSError err;
...@@ -217,13 +219,13 @@ static int check_offscreen(int win) { ...@@ -217,13 +219,13 @@ static int check_offscreen(int win) {
extern int macosx_ncache_macmenu; extern int macosx_ncache_macmenu;
void macosxCGS_get_all_windows(void) { void macosxCGS_get_all_windows(void) {
static double last = 0.0; static double last = 0.0;
static int totcnt = 0; static int totcnt = 0;
double dt = 0.0, now = dnow(); double dt = 0.0, now = dnow();
int i, db = 0, whist_prv, maxwin = 0, whist_skip = 0; int i, db = 0, whist_prv = 0, maxwin = 0, whist_skip = 0;
CGSWindowCount cap = (CGSWindowCount) MAXWINDAT; CGSWindowCount cap = (CGSWindowCount) MAXWINDAT;
CGSWindowCount cnt = 0;
CGSError err; CGSError err;
CGS_levelmax = 0; CGS_levelmax = 0;
...@@ -267,7 +269,7 @@ void macosxCGS_get_all_windows(void) { ...@@ -267,7 +269,7 @@ void macosxCGS_get_all_windows(void) {
err = CGSGetWindowList(cid, NULL, cap, _wins_all, &_wins_all_cnt); err = CGSGetWindowList(cid, NULL, cap, _wins_all, &_wins_all_cnt);
if (db) fprintf(stderr, "cnt: %d err: %d\n", _wins_all_cnt, err); if (db) fprintf(stderr, "cnt: %d err: %d\n", (int) _wins_all_cnt, err);
if (err != 0) { if (err != 0) {
return; return;
...@@ -330,7 +332,7 @@ if (0 || db) fprintf(stderr, "i=%03d ID: %06d x: %03d y: %03d w: %03d h: %03d ...@@ -330,7 +332,7 @@ if (0 || db) fprintf(stderr, "i=%03d ID: %06d x: %03d y: %03d w: %03d h: %03d
err = CGSGetOnScreenWindowList(cid, NULL, cap, _wins_mapped, &_wins_mapped_cnt); err = CGSGetOnScreenWindowList(cid, NULL, cap, _wins_mapped, &_wins_mapped_cnt);
if (db) fprintf(stderr, "cnt: %d err: %d\n", _wins_mapped_cnt, err); if (db) fprintf(stderr, "cnt: %d err: %d\n", (int) _wins_mapped_cnt, err);
if (err != 0) { if (err != 0) {
return; return;
...@@ -394,9 +396,9 @@ if (db) fprintf(stderr, "cnt: %d err: %d\n", _wins_mapped_cnt, err); ...@@ -394,9 +396,9 @@ if (db) fprintf(stderr, "cnt: %d err: %d\n", _wins_mapped_cnt, err);
; ;
} else if ( !(prev & is_mapped) && (curr & is_mapped)) { } else if ( !(prev & is_mapped) && (curr & is_mapped)) {
/* MapNotify */ /* MapNotify */
fprintf(stderr, "MapNotify: %d/%d %d %.4f %d tot=%d\n", prev, curr, win, dnowx(), totcnt); fprintf(stderr, "MapNotify: %d/%d %d %.4f tot=%d\n", prev, curr, win, dnowx(), totcnt);
macosx_add_mapnotify(win, macwins[i].level, 1); macosx_add_mapnotify(win, macwins[i].level, 1);
//macosxCGS_follow_animation_win(win, i, 1); if (0) macosxCGS_follow_animation_win(win, i, 1);
} else if ( !(curr & is_mapped) && (prev & is_mapped)) { } else if ( !(curr & is_mapped) && (prev & is_mapped)) {
/* UnmapNotify */ /* UnmapNotify */
...@@ -532,6 +534,7 @@ void macosxGCS_poll_pb(void) { ...@@ -532,6 +534,7 @@ void macosxGCS_poll_pb(void) {
} }
dlast = now; dlast = now;
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
[pblock lock]; [pblock lock];
if (pbcnt != [[NSPasteboard generalPasteboard] changeCount]) { if (pbcnt != [[NSPasteboard generalPasteboard] changeCount]) {
...@@ -550,6 +553,7 @@ void macosxGCS_poll_pb(void) { ...@@ -550,6 +553,7 @@ void macosxGCS_poll_pb(void) {
} }
[pblock unlock]; [pblock unlock];
[pool release]; [pool release];
}
} }
#endif #endif
......
...@@ -7,6 +7,7 @@ extern void macosxCGS_get_all_windows(void); ...@@ -7,6 +7,7 @@ extern void macosxCGS_get_all_windows(void);
extern int macosxCGS_get_qlook(int); extern int macosxCGS_get_qlook(int);
extern void macosxGCS_set_pasteboard(char *str, int len); extern void macosxGCS_set_pasteboard(char *str, int len);
extern int macosxCGS_follow_animation_win(int win, int idx, int grow); extern int macosxCGS_follow_animation_win(int win, int idx, int grow);
extern int macosxCGS_find_index(int w);
#endif /* _X11VNC_MACOSXCGS_H */ #endif /* _X11VNC_MACOSXCGS_H */
...@@ -547,6 +547,8 @@ static void hint_updates(void) { ...@@ -547,6 +547,8 @@ static void hint_updates(void) {
int x, y, i, n, ty, th, tx, tw; int x, y, i, n, ty, th, tx, tw;
int hint_count = 0, in_run = 0; int hint_count = 0, in_run = 0;
hint.x = hint.y = hint.w = hint.h = 0;
for (y=0; y < ntiles_y; y++) { for (y=0; y < ntiles_y; y++) {
for (x=0; x < ntiles_x; x++) { for (x=0; x < ntiles_x; x++) {
n = x + y * ntiles_x; n = x + y * ntiles_x;
...@@ -3069,7 +3071,6 @@ int scan_for_updates(int count_only) { ...@@ -3069,7 +3071,6 @@ int scan_for_updates(int count_only) {
/* scan with the initial y to the jitter value from scanlines: */ /* scan with the initial y to the jitter value from scanlines: */
scan_in_progress = 1; scan_in_progress = 1;
tile_count = scan_display(scanlines[scan_count], 0); tile_count = scan_display(scanlines[scan_count], 0);
//if (tile_count) fprintf(stderr, "XX tile_countA: %d\n", tile_count);
SCAN_FATAL(tile_count); SCAN_FATAL(tile_count);
/* /*
...@@ -3132,14 +3133,12 @@ int scan_for_updates(int count_only) { ...@@ -3132,14 +3133,12 @@ int scan_for_updates(int count_only) {
cp = (NSCAN - scan_count) % NSCAN; cp = (NSCAN - scan_count) % NSCAN;
tile_count = scan_display(scanlines[cp], 1); tile_count = scan_display(scanlines[cp], 1);
//fprintf(stderr, "XX tile_countB: %d\n", tile_count);
SCAN_FATAL(tile_count); SCAN_FATAL(tile_count);
if (tile_count >= (1 + frac2) * tile_count_old) { if (tile_count >= (1 + frac2) * tile_count_old) {
/* on a roll... do a 3rd scan */ /* on a roll... do a 3rd scan */
cp = (NSCAN - scan_count + 7) % NSCAN; cp = (NSCAN - scan_count + 7) % NSCAN;
tile_count = scan_display(scanlines[cp], 1); tile_count = scan_display(scanlines[cp], 1);
//fprintf(stderr, "XX tile_countC: %d\n", tile_count);
SCAN_FATAL(tile_count); SCAN_FATAL(tile_count);
} }
} }
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include "v4l.h" #include "v4l.h"
#include "linuxfb.h" #include "linuxfb.h"
#include "macosx.h" #include "macosx.h"
#include "macosxCG.h"
void set_greyscale_colormap(void); void set_greyscale_colormap(void);
void set_hi240_colormap(void); void set_hi240_colormap(void);
......
...@@ -1510,7 +1510,7 @@ void accept_openssl(int mode) { ...@@ -1510,7 +1510,7 @@ void accept_openssl(int mode) {
} }
if (have_httpd) { if (have_httpd) {
int n, is_http; int n = 0, is_http;
int hport = screen->httpPort; int hport = screen->httpPort;
char *iface = NULL; char *iface = NULL;
char *buf, *tbuf; char *buf, *tbuf;
......
...@@ -82,10 +82,10 @@ static char *devs[] = { ...@@ -82,10 +82,10 @@ static char *devs[] = {
*/ */
int check_uinput(void) { int check_uinput(void) {
int i;
#ifndef UINPUT_OK #ifndef UINPUT_OK
return 0; return 0;
#else #else
int i;
if (UT.release) { if (UT.release) {
int maj, min; int maj, min;
/* guard against linux 2.4 */ /* guard against linux 2.4 */
...@@ -455,6 +455,8 @@ static void ptr_move(int dx, int dy) { ...@@ -455,6 +455,8 @@ static void ptr_move(int dx, int dy) {
ev.code = SYN_REPORT; ev.code = SYN_REPORT;
ev.value = 0; ev.value = 0;
write(fd, &ev, sizeof(ev)); write(fd, &ev, sizeof(ev));
#else
if (!dx || !dy) {}
#endif #endif
} }
...@@ -485,6 +487,8 @@ static void ptr_abs(int x, int y) { ...@@ -485,6 +487,8 @@ static void ptr_abs(int x, int y) {
ev.code = SYN_REPORT; ev.code = SYN_REPORT;
ev.value = 0; ev.value = 0;
write(fd, &ev, sizeof(ev)); write(fd, &ev, sizeof(ev));
#else
if (!x || !y) {}
#endif #endif
} }
...@@ -668,7 +672,8 @@ static void button_click(int down, int btn) { ...@@ -668,7 +672,8 @@ static void button_click(int down, int btn) {
write(fd, &ev, sizeof(ev)); write(fd, &ev, sizeof(ev));
last_button_click = dnow(); last_button_click = dnow();
#else
if (!down || !btn) {}
#endif #endif
} }
...@@ -910,6 +915,8 @@ void uinput_key_command(int down, int keysym, rfbClientPtr client) { ...@@ -910,6 +915,8 @@ void uinput_key_command(int down, int keysym, rfbClientPtr client) {
if (0 <= scancode && scancode < 256) { if (0 <= scancode && scancode < 256) {
key_pressed[scancode] = down ? 1 : 0; key_pressed[scancode] = down ? 1 : 0;
} }
#else
if (!down || !keysym || !client) {}
#endif #endif
} }
......
...@@ -1696,7 +1696,6 @@ if (db) fprintf(stderr, " DFC(%d,%d-%d,%d)", tx1, ty1, tx2, ty2); ...@@ -1696,7 +1696,6 @@ if (db) fprintf(stderr, " DFC(%d,%d-%d,%d)", tx1, ty1, tx2, ty2);
if (fast_push) { if (fast_push) {
fb_push(); fb_push();
} }
//fb_push();
do_fb_push++; do_fb_push++;
PUSH_TEST(0); PUSH_TEST(0);
} }
...@@ -4079,9 +4078,9 @@ fprintf(stderr, "FAW orig_frame unmapped.\n"); ...@@ -4079,9 +4078,9 @@ fprintf(stderr, "FAW orig_frame unmapped.\n");
if (unmapped) { if (unmapped) {
; ;
} else if (orig_frame && macosxCGS_follow_animation_win(orig_frame, -1, 0)) { } else if (orig_frame && macosxCGS_follow_animation_win(orig_frame, -1, 0)) {
fprintf(stderr, "FAW orig_frame %d\n", orig_frame); fprintf(stderr, "FAW orig_frame %d\n", (int) orig_frame);
} else if (0 && frame && macosxCGS_follow_animation_win(frame, -1, 0)) { } else if (0 && frame && macosxCGS_follow_animation_win(frame, -1, 0)) {
fprintf(stderr, "FAW frame %d\n", frame); fprintf(stderr, "FAW frame %d\n", (int) frame);
} }
for (j=0; j<m; j++) { for (j=0; j<m; j++) {
macosxCGS_get_all_windows(); macosxCGS_get_all_windows();
...@@ -6573,7 +6572,7 @@ fprintf(stderr, "backingstore save: 0x%x %3d \n", (unsigned int) win, idx ...@@ -6573,7 +6572,7 @@ fprintf(stderr, "backingstore save: 0x%x %3d \n", (unsigned int) win, idx
if (! valid_wr(idx, win, &attr)) { if (! valid_wr(idx, win, &attr)) {
fprintf(stderr, "bs_save: not a valid X window: 0x%x\n", (unsigned int) win); fprintf(stderr, "bs_save: not a valid X window: 0x%x\n", (unsigned int) win);
/* XXX Y */ /* XXX Y */
// DELETE(idx); /* DELETE(idx); */
X_UNLOCK; X_UNLOCK;
cache_list[idx].valid = 0; cache_list[idx].valid = 0;
return 0; return 0;
...@@ -6660,7 +6659,7 @@ fprintf(stderr, "save-unders save: 0x%x %3d \n", (unsigned int) win, idx ...@@ -6660,7 +6659,7 @@ fprintf(stderr, "save-unders save: 0x%x %3d \n", (unsigned int) win, idx
if (! valid_wr(idx, win, &attr)) { if (! valid_wr(idx, win, &attr)) {
fprintf(stderr, "su_save: not a valid X window: 0x%x\n", (unsigned int) win); fprintf(stderr, "su_save: not a valid X window: 0x%x\n", (unsigned int) win);
/* XXX Y */ /* XXX Y */
// DELETE(idx); /* DELETE(idx); */
X_UNLOCK; X_UNLOCK;
cache_list[idx].valid = 0; cache_list[idx].valid = 0;
return 0; return 0;
......
...@@ -133,9 +133,9 @@ static int v4l1_height(int h) { ...@@ -133,9 +133,9 @@ static int v4l1_height(int h) {
} }
static int v4l1_resize(int fd, int w, int h) { static int v4l1_resize(int fd, int w, int h) {
#ifdef V4L_OK
int dowin = 0; int dowin = 0;
#ifdef V4L_OK
memset(&v4l1_window, 0, sizeof(v4l1_window)); memset(&v4l1_window, 0, sizeof(v4l1_window));
if (ioctl(fd, VIDIOCGWIN, &v4l1_window) == -1) { if (ioctl(fd, VIDIOCGWIN, &v4l1_window) == -1) {
return 0; return 0;
...@@ -167,6 +167,8 @@ static int v4l1_resize(int fd, int w, int h) { ...@@ -167,6 +167,8 @@ static int v4l1_resize(int fd, int w, int h) {
return 0; return 0;
} }
} }
#else
if (!fd || !w || !h) {}
#endif #endif
return 1; return 1;
} }
...@@ -186,6 +188,8 @@ static void v4l1_setfreq(int fd, unsigned long freq, int verb) { ...@@ -186,6 +188,8 @@ static void v4l1_setfreq(int fd, unsigned long freq, int verb) {
last_freq = freq; last_freq = freq;
} }
} }
#else
if (!fd || !freq || !verb) {}
#endif #endif
} }
...@@ -202,6 +206,8 @@ static void v4l1_set_input(int fd, int which) { ...@@ -202,6 +206,8 @@ static void v4l1_set_input(int fd, int which) {
ioctl(fd, VIDIOCSCHAN, &v4l1_channel); ioctl(fd, VIDIOCSCHAN, &v4l1_channel);
} }
} }
#else
if (!fd || !which) {}
#endif #endif
} }
...@@ -224,6 +230,8 @@ static int v4l1_setfmt(int fd, char *fmt) { ...@@ -224,6 +230,8 @@ static int v4l1_setfmt(int fd, char *fmt) {
free(raw_fb_pixfmt); free(raw_fb_pixfmt);
} }
raw_fb_pixfmt = strdup(fmt); raw_fb_pixfmt = strdup(fmt);
#else
if (!fd || !fmt) {}
#endif #endif
return 1; return 1;
} }
...@@ -231,12 +239,12 @@ static int v4l1_setfmt(int fd, char *fmt) { ...@@ -231,12 +239,12 @@ static int v4l1_setfmt(int fd, char *fmt) {
static int ignore_all = 0; static int ignore_all = 0;
static void apply_settings(char *dev, char *settings, int *fd) { static void apply_settings(char *dev, char *settings, int *fd) {
#ifdef V4L_OK
char *str, *p, *fmt = NULL, *tun = NULL, *inp = NULL; char *str, *p, *fmt = NULL, *tun = NULL, *inp = NULL;
int br = -1, co = -1, cn = -1, hu = -1; int br = -1, co = -1, cn = -1, hu = -1;
int w = -1, h = -1, b = -1; int w = -1, h = -1, b = -1;
int sta = -1; int sta = -1;
int setcnt = 0; int setcnt = 0;
#ifdef V4L_OK
if (! settings || settings[0] == '\0') { if (! settings || settings[0] == '\0') {
return; return;
} }
...@@ -380,6 +388,7 @@ static void apply_settings(char *dev, char *settings, int *fd) { ...@@ -380,6 +388,7 @@ static void apply_settings(char *dev, char *settings, int *fd) {
v4l1_cap = v4l1_query(*fd, 1); v4l1_cap = v4l1_query(*fd, 1);
v4l2_cap = v4l2_query(*fd, 1); v4l2_cap = v4l2_query(*fd, 1);
#else #else
if (!dev || !settings || !fd) {}
return; return;
#endif #endif
} }
...@@ -421,6 +430,8 @@ static void v4l_br(int b) { ...@@ -421,6 +430,8 @@ static void v4l_br(int b) {
v4l1_picture.brightness = v4l1_dpct(old, b); v4l1_picture.brightness = v4l1_dpct(old, b);
ioctl(raw_fb_fd, VIDIOCSPICT, &v4l1_picture); ioctl(raw_fb_fd, VIDIOCSPICT, &v4l1_picture);
v4l_requery(); v4l_requery();
#else
if (!b) {}
#endif #endif
} }
...@@ -431,6 +442,8 @@ static void v4l_hu(int b) { ...@@ -431,6 +442,8 @@ static void v4l_hu(int b) {
v4l1_picture.hue = v4l1_dpct(old, b); v4l1_picture.hue = v4l1_dpct(old, b);
ioctl(raw_fb_fd, VIDIOCSPICT, &v4l1_picture); ioctl(raw_fb_fd, VIDIOCSPICT, &v4l1_picture);
v4l_requery(); v4l_requery();
#else
if (!b) {}
#endif #endif
} }
...@@ -441,6 +454,8 @@ static void v4l_co(int b) { ...@@ -441,6 +454,8 @@ static void v4l_co(int b) {
v4l1_picture.colour = v4l1_dpct(old, b); v4l1_picture.colour = v4l1_dpct(old, b);
ioctl(raw_fb_fd, VIDIOCSPICT, &v4l1_picture); ioctl(raw_fb_fd, VIDIOCSPICT, &v4l1_picture);
v4l_requery(); v4l_requery();
#else
if (!b) {}
#endif #endif
} }
...@@ -451,6 +466,8 @@ static void v4l_cn(int b) { ...@@ -451,6 +466,8 @@ static void v4l_cn(int b) {
v4l1_picture.contrast = v4l1_dpct(old, b); v4l1_picture.contrast = v4l1_dpct(old, b);
ioctl(raw_fb_fd, VIDIOCSPICT, &v4l1_picture); ioctl(raw_fb_fd, VIDIOCSPICT, &v4l1_picture);
v4l_requery(); v4l_requery();
#else
if (!b) {}
#endif #endif
} }
...@@ -488,6 +505,8 @@ static void v4l_sz(int b) { ...@@ -488,6 +505,8 @@ static void v4l_sz(int b) {
ignore_all = 1; ignore_all = 1;
do_new_fb(1); do_new_fb(1);
ignore_all = 0; ignore_all = 0;
#else
if (!b) {}
#endif #endif
} }
...@@ -522,6 +541,8 @@ static void v4l_sta(int sta) { ...@@ -522,6 +541,8 @@ static void v4l_sta(int sta) {
} }
fprintf(stderr, "to station %d / %d\n", cur, (int) freq); fprintf(stderr, "to station %d / %d\n", cur, (int) freq);
v4l1_setfreq(raw_fb_fd, freq, 0); v4l1_setfreq(raw_fb_fd, freq, 0);
#else
if (!sta) {}
#endif #endif
} }
...@@ -544,6 +565,8 @@ static void v4l_inp(int inp) { ...@@ -544,6 +565,8 @@ static void v4l_inp(int inp) {
next = inp; next = inp;
} }
v4l1_set_input(raw_fb_fd, next); v4l1_set_input(raw_fb_fd, next);
#else
if (!inp) {}
#endif #endif
} }
...@@ -732,6 +755,8 @@ static unsigned short v4l1_lu_palette_str(char *name, int *bits, int *rev) { ...@@ -732,6 +755,8 @@ static unsigned short v4l1_lu_palette_str(char *name, int *bits, int *rev) {
*bits = 8; *bits = 8;
return VIDEO_PALETTE_GREY; return VIDEO_PALETTE_GREY;
} }
#else
if (!name || !bits || !rev) {}
#endif #endif
return 0; return 0;
} }
...@@ -814,6 +839,8 @@ static unsigned int v4l2_lu_palette_str(char *name, int *bits, int *rev) { ...@@ -814,6 +839,8 @@ static unsigned int v4l2_lu_palette_str(char *name, int *bits, int *rev) {
*rev = 0; *rev = 0;
return V4L2_PIX_FMT_GREY; return V4L2_PIX_FMT_GREY;
} }
#else
if (!name || !bits || !rev) {}
#endif #endif
return 0; return 0;
} }
...@@ -912,6 +939,7 @@ static int v4l1_query(int fd, int v) { ...@@ -912,6 +939,7 @@ static int v4l1_query(int fd, int v) {
return 1; return 1;
#else #else
if (!fd || !v) {}
return 0; return 0;
#endif /* V4L_OK */ #endif /* V4L_OK */
...@@ -992,6 +1020,7 @@ static int v4l2_query(int fd, int v) { ...@@ -992,6 +1020,7 @@ static int v4l2_query(int fd, int v) {
return 1; return 1;
#else #else
if (!fd || !v) {}
return 0; return 0;
#endif /* V4L_OK && HAVE_V4L2 */ #endif /* V4L_OK && HAVE_V4L2 */
...@@ -1089,6 +1118,7 @@ if (0) fprintf(stderr, "v4l1: %d %d %d\n", g_w, g_h, g_d); ...@@ -1089,6 +1118,7 @@ if (0) fprintf(stderr, "v4l1: %d %d %d\n", g_w, g_h, g_d);
close(dfd); close(dfd);
return NULL; return NULL;
#else #else
if (!dev || !fd) {}
return NULL; return NULL;
#endif #endif
} }
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include "cleanup.h" #include "cleanup.h"
#include "xwrappers.h" #include "xwrappers.h"
#include "connections.h" #include "connections.h"
#include "macosx.h"
winattr_t *stack_list = NULL; winattr_t *stack_list = NULL;
int stack_list_len = 0; int stack_list_len = 0;
......
...@@ -1145,7 +1145,8 @@ void xcut_receive(char *text, int len, rfbClientPtr cl) { ...@@ -1145,7 +1145,8 @@ void xcut_receive(char *text, int len, rfbClientPtr cl) {
#ifdef MACOSX #ifdef MACOSX
if (macosx_console) { if (macosx_console) {
return macosx_set_sel(text, len); macosx_set_sel(text, len);
return;
} }
#endif #endif
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include "xevents.h" #include "xevents.h"
#include "connections.h" #include "connections.h"
#include "cleanup.h" #include "cleanup.h"
#include "macosx.h"
int xshm_present = 0; int xshm_present = 0;
int xtest_present = 0; int xtest_present = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment