C++ from C xmp.h function call: XpmCreatePixmapFromData
I am writing this little dockapp in C++ converting what I can from C using the, if you've heard of it, wmgeneral.c file to help create the dockapp window.
within it are a bunch of hand written functions that where using Code:
char *something = "whatever"; Code:
ISO C++ forbids converting a string constant to 'char*' Code:
char const *something = " whatever"; Code:
static char const * bgmask_xpm[] = { now I have an outside function call coming from xmp.h called. Code:
FUNC(XpmCreatePixmapFromData, int, (Display *display, how do I get that function to conform from a char **data to a char const **data without having to re-code their code? I'm getting this Code:
( though I seen it pop open the header in codeblocks to show me what it's talking about. -- MAYBE just edit that one add const into its definition and cross my fingers? ;) ) |
UPDATE: casting didn't work...
Code:
err = XpmCreatePixmapFromData(display, Root, (char **)pixmap_bytes, &(wmgen->pixmap), &(wmgen->mask), &(wmgen->attributes)); Code:
||=== Build: Debug in wmslideshow (compiler: GNU GCC Compiler) ===| |
Here you go: http://en.cppreference.com/w/cpp/language/const_cast
|
Quote:
Code:
static void GetXPM(XpmIcon *wmgen, char const *pixmap_bytes[]) { |
Got it! onward and upwards...
|
All times are GMT -5. The time now is 08:53 PM. |