- src/driver/scr_fb.c
Environment: SCREEN_WIDTH/SCREEN_HEIGHT not defined
Error:
1>....\application\shell\sys\linux\applets\nanox\raw\src\drivers\scr_fb.c(96,42): error : use of undeclared identifier 'SCREEN_WIDTH'
1>....\application\shell\sys\linux\applets\nanox\raw\src\drivers\scr_fb.c(96,56): error : use of undeclared identifier 'SCREEN_HEIGHT'
Solution: add code like below like other screen drivers
#ifndef SCREEN_WIDTH
#define SCREEN_WIDTH 1024
#endif
#ifndef SCREEN_HEIGHT
#define SCREEN_HEIGHT 768
#endif
- src/nanox/srvfunc.c src/nanox/srvutil.c
Compiler: IAR EWARM
Error:
Error[Pe167]: argument of type "void (*)(void *)" is incompatible with parameter of type "void " D:\vsf.demo\application\shell\sys\linux\applets\nanox\raw\src\nanox\srvfunc.c 3600
Error[Pe167]: argument of type "void ()(void *)" is incompatible with parameter of type "void *" D:\vsf.demo\application\shell\sys\linux\applets\nanox\raw\src\nanox\srvfunc.c 3609
Solution:
add type conversion, (void *)
- src/nanox/srvmain.c
Compiler: IAR EWARM
Error:
Error[Pe167]: argument of type "void *" is incompatible with parameter of type "sighandler_t" D:\vsf.demo\application\shell\sys\linux\applets\nanox\raw\src\nanox\srvmain.c 979
Solution:
use type conversion, (sighandler_t) instead of (void *)
- src/nx11/Xrm.c
Compiler: Visual Studio - clang-cl
Error:
1>....\application\shell\sys\linux\applets\nanox\raw\src\nx11\Xrm.c(1611,16): error : call to undeclared function '_XOpenFile'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
Solution:
Add declaration: extern int _XOpenFile(_Xconst char *path, int flags);
src/nanox/srvfunc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/nanox/srvfunc.c b/src/nanox/srvfunc.c
index 4db4b27..a3f82ac 100644
--- a/src/nanox/srvfunc.c
+++ b/src/nanox/srvfunc.c
@@ -3597,7 +3597,7 @@ GrSetScreenSaverTimeout(GR_TIMEOUT timeout)
screensaver_delay = timeout * 1000;
- if((timer = GdFindTimer(GsActivateScreenSaver)))
+ if((timer = GdFindTimer((void *)GsActivateScreenSaver)))
GdDestroyTimer(timer);
/* 0 timeout cancels timer*/
@@ -3606,7 +3606,7 @@ GrSetScreenSaverTimeout(GR_TIMEOUT timeout)
return;
}
- GdAddTimer(screensaver_delay, GsActivateScreenSaver, GsActivateScreenSaver);
+ GdAddTimer(screensaver_delay, GsActivateScreenSaver, (void *)GsActivateScreenSaver);
SERVER_UNLOCK();
#endif /* MW_FEATURE_TIMERS */
src/nanox/srvutil.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/nanox/srvutil.c b/src/nanox/srvutil.c
index 8d49668..294ba5b 100644
--- a/src/nanox/srvutil.c
+++ b/src/nanox/srvutil.c
@@ -50,10 +50,10 @@ GsResetScreenSaver(void)
if(screensaver_delay) {
MWTIMER *timer;
- if((timer = GdFindTimer(GsActivateScreenSaver)))
+ if((timer = GdFindTimer((void *)GsActivateScreenSaver)))
GdDestroyTimer(timer);
- GdAddTimer(screensaver_delay, GsActivateScreenSaver, GsActivateScreenSaver);
+ GdAddTimer(screensaver_delay, GsActivateScreenSaver, (void *)GsActivateScreenSaver);
}
#endif
}
- src/nx11/Image.c
Compiler: Visual Studio - clang-cl
Error:
1>....\application\shell\sys\linux\applets\nanox\raw\src\nx11\Image.c(137,22): error : incompatible function pointer types assigning to 'unsigned long (*)(struct _XImage *, unsigned int, unsigned int)' from 'unsigned long (XImage *, int, int)' (aka 'unsigned long (struct _XImage , int, int)') [-Wincompatible-function-pointer-types]
1>....\application\shell\sys\linux\applets\nanox\raw\src\nx11\Image.c(138,22): error : incompatible function pointer types assigning to 'int ()(struct _XImage *, unsigned int, unsigned int, unsigned long)' from 'int (XImage *, int, int, unsigned long)' (aka 'int (struct _XImage , int, int, unsigned long)') [-Wincompatible-function-pointer-types]
1>....\application\shell\sys\linux\applets\nanox\raw\src\nx11\Image.c(141,22): error : incompatible function pointer types assigning to 'unsigned long ()(struct _XImage *, unsigned int, unsigned int)' from 'unsigned long (XImage *, int, int)' (aka 'unsigned long (struct _XImage , int, int)') [-Wincompatible-function-pointer-types]
1>....\application\shell\sys\linux\applets\nanox\raw\src\nx11\Image.c(142,22): error : incompatible function pointer types assigning to 'int ()(struct _XImage *, unsigned int, unsigned int, unsigned long)' from 'int (XImage *, int, int, unsigned long)' (aka 'int (struct _XImage , int, int, unsigned long)') [-Wincompatible-function-pointer-types]
1>....\application\shell\sys\linux\applets\nanox\raw\src\nx11\Image.c(145,22): error : incompatible function pointer types assigning to 'unsigned long ()(struct _XImage *, unsigned int, unsigned int)' from 'unsigned long (XImage *, int, int)' (aka 'unsigned long (struct _XImage , int, int)') [-Wincompatible-function-pointer-types]
1>....\application\shell\sys\linux\applets\nanox\raw\src\nx11\Image.c(146,22): error : incompatible function pointer types assigning to 'int ()(struct _XImage *, unsigned int, unsigned int, unsigned long)' from 'int (XImage *, int, int, unsigned long)' (aka 'int (struct _XImage , int, int, unsigned long)') [-Wincompatible-function-pointer-types]
1>....\application\shell\sys\linux\applets\nanox\raw\src\nx11\Image.c(149,22): error : incompatible function pointer types assigning to 'unsigned long ()(struct _XImage *, unsigned int, unsigned int)' from 'unsigned long (XImage *, int, int)' (aka 'unsigned long (struct _XImage , int, int)') [-Wincompatible-function-pointer-types]
1>....\application\shell\sys\linux\applets\nanox\raw\src\nx11\Image.c(150,22): error : incompatible function pointer types assigning to 'int ()(struct _XImage *, unsigned int, unsigned int, unsigned long)' from 'int (XImage *, int, int, unsigned long)' (aka 'int (struct _XImage *, int, int, unsigned long)') [-Wincompatible-function-pointer-types]
Solution:
fix prototype of get_pixel/put_pixel in _XImage
src/nx11/X11-local/X11/Xlib.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/nx11/X11-local/X11/Xlib.h b/src/nx11/X11-local/X11/Xlib.h
index a7c8e89..093fbd6 100644
--- a/src/nx11/X11-local/X11/Xlib.h
+++ b/src/nx11/X11-local/X11/Xlib.h
@@ -397,8 +397,8 @@ typedef struct _XImage {
int /* bitmap_pad */,
int /* bytes_per_line */);
int (*destroy_image) (struct _XImage *);
- unsigned long (*get_pixel) (struct _XImage *, unsigned int, unsigned int);
- int (*put_pixel) (struct _XImage *, unsigned int, unsigned int, unsigned long);
+ unsigned long (*get_pixel) (struct _XImage *, int, int);
+ int (*put_pixel) (struct _XImage *, int, int, unsigned long);
struct _XImage *(*sub_image)(struct _XImage *, int, int, unsigned int, unsigned int);
int (*add_pixel) (struct _XImage *, long);
#else
- src/nx11/SetAttributes.c
Compiler: Visual Studio - clang-cl
Error:
1>lld-link : error : undefined symbol: _XSetWindowBorderPixmap
1>>>> referenced by D:\vsf.demo\application\shell\sys\linux\applets\nanox\raw\src\nx11\SetAttributes.c:16
1>>>> vsf_demo\Debug/__sub0/__sub1/__sub2/__sub3/....\application\shell\sys\linux\applets\nanox\raw\src\nx11\SetAttributes.obj:(_XChangeWindowAttributes)
1>
1>lld-link : error : undefined symbol: _XSetWindowColormap
1>>>> referenced by D:\vsf.demo\application\shell\sys\linux\applets\nanox\raw\src\nx11\SetAttributes.c:30
1>>>> vsf_demo\Debug/__sub0/__sub1/__sub2/__sub3/....\application\shell\sys\linux\applets\nanox\raw\src\nx11\SetAttributes.obj:(_XChangeWindowAttributes)
Solution:
None, I can not find XSetWindowBorderPixmap and XSetWindowColormap implementation.
I simply remove related lines.
works well with fixes above


Environment: SCREEN_WIDTH/SCREEN_HEIGHT not defined
Error:
1>....\application\shell\sys\linux\applets\nanox\raw\src\drivers\scr_fb.c(96,42): error : use of undeclared identifier 'SCREEN_WIDTH'
1>....\application\shell\sys\linux\applets\nanox\raw\src\drivers\scr_fb.c(96,56): error : use of undeclared identifier 'SCREEN_HEIGHT'
Solution: add code like below like other screen drivers
#ifndef SCREEN_WIDTH
#define SCREEN_WIDTH 1024
#endif
#ifndef SCREEN_HEIGHT
#define SCREEN_HEIGHT 768
#endif
Compiler: IAR EWARM
Error:
Error[Pe167]: argument of type "void (*)(void *)" is incompatible with parameter of type "void " D:\vsf.demo\application\shell\sys\linux\applets\nanox\raw\src\nanox\srvfunc.c 3600
Error[Pe167]: argument of type "void ()(void *)" is incompatible with parameter of type "void *" D:\vsf.demo\application\shell\sys\linux\applets\nanox\raw\src\nanox\srvfunc.c 3609
Solution:
add type conversion, (void *)
Compiler: IAR EWARM
Error:
Error[Pe167]: argument of type "void *" is incompatible with parameter of type "sighandler_t" D:\vsf.demo\application\shell\sys\linux\applets\nanox\raw\src\nanox\srvmain.c 979
Solution:
use type conversion, (sighandler_t) instead of (void *)
Compiler: Visual Studio - clang-cl
Error:
1>....\application\shell\sys\linux\applets\nanox\raw\src\nx11\Xrm.c(1611,16): error : call to undeclared function '_XOpenFile'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
Solution:
Add declaration: extern int _XOpenFile(_Xconst char *path, int flags);
Compiler: Visual Studio - clang-cl
Error:
1>....\application\shell\sys\linux\applets\nanox\raw\src\nx11\Image.c(137,22): error : incompatible function pointer types assigning to 'unsigned long (*)(struct _XImage *, unsigned int, unsigned int)' from 'unsigned long (XImage *, int, int)' (aka 'unsigned long (struct _XImage , int, int)') [-Wincompatible-function-pointer-types]
1>....\application\shell\sys\linux\applets\nanox\raw\src\nx11\Image.c(138,22): error : incompatible function pointer types assigning to 'int ()(struct _XImage *, unsigned int, unsigned int, unsigned long)' from 'int (XImage *, int, int, unsigned long)' (aka 'int (struct _XImage , int, int, unsigned long)') [-Wincompatible-function-pointer-types]
1>....\application\shell\sys\linux\applets\nanox\raw\src\nx11\Image.c(141,22): error : incompatible function pointer types assigning to 'unsigned long ()(struct _XImage *, unsigned int, unsigned int)' from 'unsigned long (XImage *, int, int)' (aka 'unsigned long (struct _XImage , int, int)') [-Wincompatible-function-pointer-types]
1>....\application\shell\sys\linux\applets\nanox\raw\src\nx11\Image.c(142,22): error : incompatible function pointer types assigning to 'int ()(struct _XImage *, unsigned int, unsigned int, unsigned long)' from 'int (XImage *, int, int, unsigned long)' (aka 'int (struct _XImage , int, int, unsigned long)') [-Wincompatible-function-pointer-types]
1>....\application\shell\sys\linux\applets\nanox\raw\src\nx11\Image.c(145,22): error : incompatible function pointer types assigning to 'unsigned long ()(struct _XImage *, unsigned int, unsigned int)' from 'unsigned long (XImage *, int, int)' (aka 'unsigned long (struct _XImage , int, int)') [-Wincompatible-function-pointer-types]
1>....\application\shell\sys\linux\applets\nanox\raw\src\nx11\Image.c(146,22): error : incompatible function pointer types assigning to 'int ()(struct _XImage *, unsigned int, unsigned int, unsigned long)' from 'int (XImage *, int, int, unsigned long)' (aka 'int (struct _XImage , int, int, unsigned long)') [-Wincompatible-function-pointer-types]
1>....\application\shell\sys\linux\applets\nanox\raw\src\nx11\Image.c(149,22): error : incompatible function pointer types assigning to 'unsigned long ()(struct _XImage *, unsigned int, unsigned int)' from 'unsigned long (XImage *, int, int)' (aka 'unsigned long (struct _XImage , int, int)') [-Wincompatible-function-pointer-types]
1>....\application\shell\sys\linux\applets\nanox\raw\src\nx11\Image.c(150,22): error : incompatible function pointer types assigning to 'int ()(struct _XImage *, unsigned int, unsigned int, unsigned long)' from 'int (XImage *, int, int, unsigned long)' (aka 'int (struct _XImage *, int, int, unsigned long)') [-Wincompatible-function-pointer-types]
Solution:
fix prototype of get_pixel/put_pixel in _XImage
Compiler: Visual Studio - clang-cl
Error:
1>lld-link : error : undefined symbol: _XSetWindowBorderPixmap
1>>>> referenced by D:\vsf.demo\application\shell\sys\linux\applets\nanox\raw\src\nx11\SetAttributes.c:16
1>>>> vsf_demo\Debug/__sub0/__sub1/__sub2/__sub3/....\application\shell\sys\linux\applets\nanox\raw\src\nx11\SetAttributes.obj:(_XChangeWindowAttributes)
1>
1>lld-link : error : undefined symbol: _XSetWindowColormap
1>>>> referenced by D:\vsf.demo\application\shell\sys\linux\applets\nanox\raw\src\nx11\SetAttributes.c:30
1>>>> vsf_demo\Debug/__sub0/__sub1/__sub2/__sub3/....\application\shell\sys\linux\applets\nanox\raw\src\nx11\SetAttributes.obj:(_XChangeWindowAttributes)
Solution:
None, I can not find XSetWindowBorderPixmap and XSetWindowColormap implementation.
I simply remove related lines.
works well with fixes above

