Step 1: make it actually compile. (Done.)
Step 2: turn on -Werror and fix all the warnings. (Still working on that...)
Step 3: start adding the features I want. Make sure it compiles without errors or warnings. Make sure it actually runs, and does what I want. Rinse and repeat...
Unfortunately that second part is is a bit like wrestling with a boa constrictor, if you know what I mean.
Case in point, the very first one:
- Code: Select all
char **missing, *def = "-";
int nmissing;
// load the fontset
fs = XCreateFontSet(_display.XDisplay(), fontsetname.c_str(),
&missing, &nmissing, &def);
That first line generates a warning in C++. def is initialized from a constant string literal, but is itself mutable, which may not be what you expect; and it gets modified by XCreateFontSet(), whose documentation doesn't actually specify the length of the string it will stuff into that buffer. def is probably going to be initialized to 2 bytes ('-' and the null terminator). XCreateFontSet might then try to force, I dunno, 16 bytes into it. Oops. Not sure how I'll deal with that.
(Also this is the first time I've seen a pointer to a pointer to a pointer... Anywhere, I think. Not sure if that's just because I'm a newbie.)
Anyway I guess I'll sleep on it.