Drop c11 to c99

This commit is contained in:
vCaesar 2017-01-05 19:57:03 +08:00
parent 7f44a34f89
commit d5c553b760
7 changed files with 22 additions and 13 deletions

View File

@ -417,8 +417,8 @@ static inline void process_key_pressed(uint64_t timestamp, CGEventRef event_ref)
else {
keycode_to_lookup(tis_message);
}
for (unsigned int i = 0; i < tis_message->length; i++) {
unsigned int i;
for (i= 0; i < tis_message->length; i++) {
// Populate key typed event.
event.time = timestamp;
event.reserved = 0x00;

View File

@ -44,7 +44,8 @@ IOHOOK_API screen_data* hook_create_screen_info(unsigned char *count) {
// Allocate memory for the number of screens found.
screens = malloc(sizeof(screen_data) * (*count));
if (screens != NULL) {
for (uint8_t i = 0; i < *count; i++) {
uint8_t i;
for (i = 0; i < *count; i++) {
//size_t width = CGDisplayPixelsWide(display_ids[i]);
//size_t height = CGDisplayPixelsHigh(display_ids[i]);
CGRect boundsDisp = CGDisplayBounds(display_ids[i]);

View File

@ -319,13 +319,15 @@ IOHOOK_API void hook_post_event(iohook_event * const event) {
#ifdef USE_XTEST
// XTest does not have modifier support, so we fake it by depressing the
// appropriate modifier keys.
for (unsigned int i = 0; i < sizeof(keymask_lookup) / sizeof(KeySym); i++) {
unsigned int i;
for (i = 0; i < sizeof(keymask_lookup) / sizeof(KeySym); i++) {
if (event->mask & 1 << i) {
XTestFakeKeyEvent(properties_disp, XKeysymToKeycode(properties_disp, keymask_lookup[i]), True, 0);
}
}
for (unsigned int i = 0; i < sizeof(btnmask_lookup) / sizeof(unsigned int); i++) {
unsigned int i;
for (i = 0; i < sizeof(btnmask_lookup) / sizeof(unsigned int); i++) {
if (event->mask & btnmask_lookup[i]) {
XTestFakeButtonEvent(properties_disp, i + 1, True, 0);
}
@ -364,13 +366,14 @@ IOHOOK_API void hook_post_event(iohook_event * const event) {
#ifdef USE_XTEST
// Release the previously held modifier keys used to fake the event mask.
for (unsigned int i = 0; i < sizeof(keymask_lookup) / sizeof(KeySym); i++) {
unsigned int i ;
for (i= 0; i < sizeof(keymask_lookup) / sizeof(KeySym); i++) {
if (event->mask & 1 << i) {
XTestFakeKeyEvent(properties_disp, XKeysymToKeycode(properties_disp, keymask_lookup[i]), False, 0);
}
}
for (unsigned int i = 0; i < sizeof(btnmask_lookup) / sizeof(unsigned int); i++) {
unsigned int i;
for (i = 0; i < sizeof(btnmask_lookup) / sizeof(unsigned int); i++) {
if (event->mask & btnmask_lookup[i]) {
XTestFakeButtonEvent(properties_disp, i + 1, False, 0);
}

View File

@ -354,7 +354,8 @@ void hook_event_proc(XPointer closeure, XRecordInterceptData *recorded_data) {
count = keysym_to_unicode(keysym, buffer, sizeof(buffer) / sizeof(uint16_t));
#endif
for (unsigned int i = 0; i < count; i++) {
unsigned int i;
for (i = 0; i < count; i++) {
// Populate key typed event.
event.time = timestamp;
event.reserved = 0x00;

View File

@ -1927,7 +1927,8 @@ void load_input_helper(Display *disp) {
keysym_per_keycode--;
// Loop over the modifier map to find out if/where shift and caps locks are set.
for (int i = LockMapIndex; i < LockMapIndex + modifierMap->max_keypermod && !is_caps_lock; i++) {
int i;
for (i = LockMapIndex; i < LockMapIndex + modifierMap->max_keypermod && !is_caps_lock; i++) {
if (capsLock != 0 && modifierMap->modifiermap[i] == capsLock) {
is_caps_lock = true;
is_shift_lock = false;

View File

@ -132,7 +132,8 @@ IOHOOK_API screen_data* hook_create_screen_info(unsigned char *count) {
screens = malloc(sizeof(screen_data) * xine_count);
if (screens != NULL) {
for (int i = 0; i < xine_count; i++) {
int i;
for (i = 0; i < xine_count; i++) {
screens[i] = (screen_data) {
.number = xine_info[i].screen_number,
.x = xine_info[i].x_org,
@ -163,7 +164,8 @@ IOHOOK_API screen_data* hook_create_screen_info(unsigned char *count) {
screens = malloc(sizeof(screen_data) * xrandr_count);
if (screens != NULL) {
for (int i = 0; i < xrandr_count; i++) {
int i;
for (i = 0; i < xrandr_count; i++) {
XRRCrtcInfo *crtc_info = XRRGetCrtcInfo(properties_disp, xrandr_resources, xrandr_resources->crtcs[i]);
if (crtc_info != NULL) {

View File

@ -15,7 +15,8 @@ package robotgo
#cgo darwin CFLAGS: -x objective-c -Wno-deprecated-declarations -I/usr/local/opt/libpng/include -I/usr/local/opt/zlib/include
#cgo darwin LDFLAGS: -framework Cocoa -framework OpenGL -framework IOKit -framework Carbon -framework CoreFoundation -L/usr/local/opt/libpng/lib -lpng -L/usr/local/opt/zlib/lib -lz
//#elif defined(USE_X11)
#cgo linux CFLAGS:-std=c11 -I/usr/src
//drop -std=c11
#cgo linux CFLAGS:-I/usr/src
#cgo linux LDFLAGS:-L/usr/src -lpng -lz -lX11 -lXtst -lX11-xcb -lxcb -lxcb-xkb -lxkbcommon -lxkbcommon-x11 -lm
//#endif
#cgo windows LDFLAGS: -lgdi32 -luser32 -lpng -lz