1
0
forked from vitrine/wmaker

Remove warnings

* Remove assigned but not used variables (GCC 4.6)
* Bump _XOPEN_SOURCE to 600, ridding of FreeBSD warnings (this probably need
  to be tweaked on a per-implementation basis as problems arise)
This commit is contained in:
Tamas TEVESZ
2011-03-24 16:07:20 +01:00
committed by Carlos R. Mafra
parent 43c7abe79f
commit f65b99e615
45 changed files with 83 additions and 174 deletions

View File

@@ -16,6 +16,7 @@
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <stdio.h>
#ifdef __cplusplus

View File

@@ -1,10 +1,4 @@
#if __GLIBC__ && \
(_XOPEN_SOURCE && _XOPEN_SOURCE < 500) || \
!_XOPEN_SOURCE
#define _XOPEN_SOURCE 500 /* nftw */
#endif
#include <sys/types.h>
#include <sys/stat.h>

View File

@@ -1,3 +1,10 @@
/*
* Until FreeBSD gets their act together;
* http://www.mail-archive.com/freebsd-hackers@freebsd.org/msg69469.html
*/
#if defined( FREEBSD )
# undef _XOPEN_SOURCE
#endif
#include "wconfig.h"
@@ -234,7 +241,7 @@ char *wstrappend(char *dst, char *src)
}
#ifdef HAVE_STRLCAT
#if HAVE_STRLCAT
size_t
wstrlcat(char *dst, const char *src, size_t siz)
{
@@ -295,7 +302,7 @@ wstrlcat(char *dst, const char *src, size_t siz)
}
#endif /* HAVE_STRLCAT */
#ifdef HAVE_STRLCPY
#if HAVE_STRLCPY
size_t
wstrlcpy(char *dst, const char *src, size_t siz)
{

View File

@@ -1,6 +1,7 @@
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <stdio.h>
#include <assert.h>
#include <unistd.h>

View File

@@ -2725,7 +2725,6 @@ static void customSetPalette(W_ColorPanel * panel)
W_Screen *scr = WMWidgetScreen(panel->win);
RImage *scaledImg;
Pixmap image;
int item;
image = XCreatePixmap(scr->display, W_DRAWABLE(scr), customPaletteWidth, customPaletteHeight, scr->depth);
scaledImg = RScaleImage(panel->customPaletteImg, customPaletteWidth, customPaletteHeight);
@@ -2751,7 +2750,7 @@ static void customSetPalette(W_ColorPanel * panel)
panel->palXRatio = (double)(panel->customPaletteImg->width) / (double)(customPaletteWidth);
panel->palYRatio = (double)(panel->customPaletteImg->height) / (double)(customPaletteHeight);
item = WMGetPopUpButtonSelectedItem(panel->customPaletteHistoryBtn);
WMGetPopUpButtonSelectedItem(panel->customPaletteHistoryBtn);
}
static void customPalettePositionSelection(W_ColorPanel * panel, int x, int y)
@@ -3366,7 +3365,7 @@ static int fetchFile(char *toPath, char *srcFile, char *destFile)
break;
RETRY( nwritten = fwrite(buf, 1, nread, dst) )
if (ferror(dst) || feof(src))
if (ferror(dst) || feof(src) || nread != nwritten)
break;
} while (1);

View File

@@ -5,6 +5,7 @@
#include <ctype.h>
#include <string.h>
#include <strings.h>
#include <stdint.h>
#include <X11/Xft/Xft.h>

View File

@@ -390,12 +390,9 @@ static void scrollByAmount(WMList * lPtr, int amount)
static void vScrollCallBack(WMWidget * scroller, void *self)
{
WMList *lPtr = (WMList *) self;
int height;
int oldTopItem = lPtr->topItem;
int itemCount = WMGetArrayItemCount(lPtr->items);
height = lPtr->view->size.height - 4;
switch (WMGetScrollerHitPart((WMScroller *) scroller)) {
case WSDecrementLine:
scrollByAmount(lPtr, -1);

View File

@@ -330,7 +330,7 @@ static void paintMenuEntry(PopUpButton * bPtr, int index, int highlight)
{
W_Screen *scr = bPtr->view->screen;
int yo;
int width, height, itemHeight, itemCount;
int width, itemHeight, itemCount;
char *title;
itemCount = WMGetArrayItemCount(bPtr->items);
@@ -339,7 +339,6 @@ static void paintMenuEntry(PopUpButton * bPtr, int index, int highlight)
itemHeight = bPtr->view->size.height;
width = bPtr->view->size.width;
height = itemHeight * itemCount;
yo = (itemHeight - WMFontHeight(scr->normalFont)) / 2;
if (!highlight) {

View File

@@ -1,4 +1,12 @@
/*
* Until FreeBSD gets their act together;
* http://www.mail-archive.com/freebsd-hackers@freebsd.org/msg69469.html
*/
#if defined( FREEBSD )
# undef _XOPEN_SOURCE
#endif
#include "WINGsP.h"
#include <math.h>

View File

@@ -722,13 +722,10 @@ void WMRemoveSplitViewSubview(WMSplitView * sPtr, WMView * view)
void WMRemoveSplitViewSubviewAt(WMSplitView * sPtr, int index)
{
W_SplitViewSubview *p;
CHECK_CLASS(sPtr, WC_SplitView);
/* TODO: same about rewrite */
if (index >= 0 && index < _GetSubviewsCount()) {
p = _GetPSubviewStructAt(index);
WMDeleteFromArray(sPtr->subviews, index);
sPtr->flags.adjustOnPaint = 1;
paintSplitView(sPtr);

View File

@@ -755,7 +755,7 @@ static void paintTextField(TextField * tPtr)
W_Screen *screen = tPtr->view->screen;
W_View *view = tPtr->view;
W_View viewbuffer;
int tx, ty, tw, th;
int tx, ty, tw;
int rx;
int bd;
int totalWidth;
@@ -792,8 +792,6 @@ static void paintTextField(TextField * tPtr)
if (tPtr->textLen > 0) {
tw = WMWidthOfString(tPtr->font, &(text[tPtr->viewPosition]), tPtr->textLen - tPtr->viewPosition);
th = WMFontHeight(tPtr->font);
ty = tPtr->offsetWidth;
switch (tPtr->flags.alignment) {
case WALeft:
@@ -1334,7 +1332,6 @@ static void pasteText(WMView * view, Atom selection, Atom target, Time timestamp
static void handleTextFieldActionEvents(XEvent * event, void *data)
{
TextField *tPtr = (TextField *) data;
static int move = 0;
static Time lastButtonReleasedEvent = 0;
static Time lastButtonReleasedEvent2 = 0;
Display *dpy = event->xany.display;
@@ -1406,7 +1403,6 @@ static void handleTextFieldActionEvents(XEvent * event, void *data)
break;
}
move = 1;
switch (tPtr->flags.alignment) {
int textWidth;
case WARight:
@@ -1485,8 +1481,6 @@ static void handleTextFieldActionEvents(XEvent * event, void *data)
XStoreBuffer(dpy, &tPtr->text[start], count, 0);
}
move = 0;
if (!tPtr->flags.secure &&
event->xbutton.time - lastButtonReleasedEvent <= WINGsConfiguration.doubleClickDelay) {

View File

@@ -1060,8 +1060,6 @@ static void changePage(WMWidget * w, void *data)
{
_Panel *panel = (_Panel *) data;
int section;
WMListItem *item;
TextureListItem *titem;
WMScreen *scr = WMWidgetScreen(panel->box);
RContext *rc = WMScreenRContext(scr);
static WMPoint positions[] = {
@@ -1080,10 +1078,6 @@ static void changePage(WMWidget * w, void *data)
WMSelectListItem(panel->texLs, panel->textureIndex[section]);
WMSetListPosition(panel->texLs, panel->textureIndex[section] - 2);
item = WMGetListItem(panel->texLs, panel->textureIndex[section]);
titem = (TextureListItem *) item->clientData;
}
{
WMColor *color;

View File

@@ -466,20 +466,18 @@ static void createPanel(_Panel * p)
{
WEditMenu *pad;
WEditMenu *smenu;
ItemData *data;
pad = makeFactoryMenu(panel->box, 150);
WMMoveWidget(pad, 10, 40);
data = putNewItem(panel, pad, ExecInfo, _("Run Program"));
data = putNewItem(panel, pad, CommandInfo, _("Internal Command"));
smenu = putNewSubmenu(pad, _("Submenu"));
data = putNewItem(panel, pad, ExternalInfo, _("External Submenu"));
data = putNewItem(panel, pad, PipeInfo, _("Generated Submenu"));
data = putNewItem(panel, pad, DirectoryInfo, _("Directory Contents"));
data = putNewItem(panel, pad, WSMenuInfo, _("Workspace Menu"));
data = putNewItem(panel, pad, WWindowListInfo, _("Window List Menu"));
putNewItem(panel, pad, ExecInfo, _("Run Program"));
putNewItem(panel, pad, CommandInfo, _("Internal Command"));
putNewSubmenu(pad, _("Submenu"));
putNewItem(panel, pad, ExternalInfo, _("External Submenu"));
putNewItem(panel, pad, PipeInfo, _("Generated Submenu"));
putNewItem(panel, pad, DirectoryInfo, _("Directory Contents"));
putNewItem(panel, pad, WSMenuInfo, _("Workspace Menu"));
putNewItem(panel, pad, WWindowListInfo, _("Window List Menu"));
panel->itemPad[0] = pad;
}

View File

@@ -427,7 +427,6 @@ static void paintGradListItem(WMList * lPtr, int index, Drawable d, char *text,
WMColor *white = WMWhiteColor(scr);
WMColor *black = WMBlackColor(scr);
WMColor *gray = WMGrayColor(scr);
WMListItem *item;
int width, height, x, y;
Display *dpy;
@@ -443,8 +442,6 @@ static void paintGradListItem(WMList * lPtr, int index, Drawable d, char *text,
else
XFillRectangle(dpy, d, WMColorGC(gray), x, y, width, height);
item = WMGetListItem(lPtr, index);
if (panel->gimage) {
XCopyArea(WMScreenDisplay(scr), panel->gimage, d, WMColorGC(white),
0, height * index, 30, height, x + 5, y);

View File

@@ -25,6 +25,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <strings.h>
#include <signal.h>
#include <X11/Xlib.h>

View File

@@ -88,7 +88,7 @@ int main(int argc, char **argv)
{
Display *dpy;
WMScreen *scr;
char *locale, *path;
char *path;
int i;
char *display_name = "";
@@ -131,7 +131,6 @@ int main(int argc, char **argv)
}
}
locale = getenv("LANG");
setlocale(LC_ALL, "");
#ifdef I18N

View File

@@ -32,6 +32,7 @@ Perpetrator: Sudish Joseph <sj@eng.mindspring.net>, Sept. 1997. */
Boston, MA 02110-1301 USA. */
#include <string.h>
#include <strings.h>
#include <X11/Xlib.h>
#include <X11/keysym.h>
@@ -110,9 +111,6 @@ static const char *index_to_name(int indice)
static void x_reset_modifier_mapping(Display * display)
{
int modifier_index, modifier_key, column, mkpm;
int warned_about_overlapping_modifiers = 0;
int warned_about_predefined_modifiers = 0;
int warned_about_duplicate_modifiers = 0;
int meta_bit = 0;
int hyper_bit = 0;
int super_bit = 0;
@@ -122,26 +120,22 @@ static void x_reset_modifier_mapping(Display * display)
#define modwarn(name,old,other) \
wwarning ("%s (0x%x) generates %s, which is generated by %s.", \
name, code, index_to_name (old), other), \
warned_about_overlapping_modifiers = 1
name, code, index_to_name (old), other)
#define modbarf(name,other) \
wwarning ("%s (0x%x) generates %s, which is nonsensical.", \
name, code, other), \
warned_about_predefined_modifiers = 1
name, code, other)
#define check_modifier(name,mask) \
if ((1<<modifier_index) != mask) \
wwarning ("%s (0x%x) generates %s, which is nonsensical.", \
name, code, index_to_name (modifier_index)), \
warned_about_predefined_modifiers = 1
name, code, index_to_name (modifier_index))
#define store_modifier(name,old) \
if (old && old != modifier_index) \
wwarning ("%s (0x%x) generates both %s and %s, which is nonsensical.", \
name, code, index_to_name (old), \
index_to_name (modifier_index)), \
warned_about_duplicate_modifiers = 1; \
index_to_name (modifier_index)); \
if (modifier_index == ShiftMapIndex) modbarf (name,"ModShift"); \
else if (modifier_index == LockMapIndex) modbarf (name,"ModLock"); \
else if (modifier_index == ControlMapIndex) modbarf (name,"ModControl"); \
@@ -253,7 +247,7 @@ static void x_reset_modifier_mapping(Display * display)
warn = "Alt", alt_bit = 0;
if (warn) {
wwarning("%s is being used for both Mode_switch and %s.",
index_to_name(mode_bit), warn), warned_about_overlapping_modifiers = 1;
index_to_name(mode_bit), warn);
}
}

View File

@@ -82,10 +82,11 @@ dnl ================================
case "${host}" in
*-*-linux*|*-*-cygwin*)
WM_OSDEP="linux"
CFLAGS="$CFLAGS -D_XOPEN_SOURCE=600"
;;
*-*-freebsd*)
WM_OSDEP="bsd"
CFLAGS="$CFLAGS -DFREEBSD"
CFLAGS="$CFLAGS -D_XOPEN_SOURCE=600 -DFREEBSD"
;;
*-*-netbsd*)
WM_OSDEP="bsd"

View File

@@ -377,7 +377,6 @@ WApplication *wApplicationCreate(WWindow * wwin)
void wApplicationDestroy(WApplication * wapp)
{
Window main_window;
WWindow *wwin;
WScreen *scr;
@@ -400,7 +399,6 @@ void wApplicationDestroy(WApplication * wapp)
}
scr = wapp->main_window_desc->screen_ptr;
main_window = wapp->main_window;
if (wapp == scr->wapp_list) {
if (wapp->next)

View File

@@ -27,6 +27,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <strings.h>
#include <ctype.h>
#include <time.h>
#include <sys/types.h>
@@ -1009,14 +1010,12 @@ void wReadDefaults(WScreen * scr, WMPropList * new_dict)
{
WMPropList *plvalue, *old_value;
WDefaultEntry *entry;
unsigned int i, must_update;
unsigned int i;
int update_workspace_back = 0; /* kluge :/ */
unsigned int needs_refresh;
void *tdata;
WMPropList *old_dict = (WDWindowMaker->dictionary != new_dict ? WDWindowMaker->dictionary : NULL);
must_update = 0;
needs_refresh = 0;
for (i = 0; i < sizeof(optionList) / sizeof(WDefaultEntry); i++) {
@@ -1037,7 +1036,6 @@ void wReadDefaults(WScreen * scr, WMPropList * new_dict)
plvalue = entry->plvalue;
if (plvalue && new_dict) {
WMPutInPLDictionary(new_dict, entry->plkey, plvalue);
must_update = 1;
}
} else if (!plvalue) {
/* value was deleted from DB. Keep current value */

View File

@@ -808,7 +808,6 @@ static void keyPressHandler(XEvent * event, void *data)
{
IconPanel *panel = (IconPanel *) data;
char buffer[32];
int count;
KeySym ksym;
int iidx;
int didx;
@@ -819,7 +818,7 @@ static void keyPressHandler(XEvent * event, void *data)
return;
buffer[0] = 0;
count = XLookupString(&event->xkey, buffer, sizeof(buffer), &ksym, NULL);
XLookupString(&event->xkey, buffer, sizeof(buffer), &ksym, NULL);
iidx = WMGetListSelectedItemRow(panel->iconList);
didx = WMGetListSelectedItemRow(panel->dirList);
@@ -1103,7 +1102,6 @@ void wShowInfoPanel(WScreen * scr)
{
InfoPanel *panel;
WMPixmap *logo;
WMSize size;
WMFont *font;
char *strbuf = NULL;
char buffer[256];
@@ -1142,7 +1140,6 @@ void wShowInfoPanel(WScreen * scr)
logo = WMRetainPixmap(WMGetApplicationIconPixmap(scr->wmscreen));
}
if (logo) {
size = WMGetPixmapSize(logo);
panel->logoL = WMCreateLabel(panel->win);
WMResizeWidget(panel->logoL, 64, 64);
WMMoveWidget(panel->logoL, 30, 20);

View File

@@ -26,6 +26,7 @@
#include <X11/Xutil.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <unistd.h>
#include <math.h>
#include <limits.h>
@@ -2262,10 +2263,9 @@ Bool wDockSnapIcon(WDock * dock, WAppIcon * icon, int req_x, int req_y, int *ret
int i, offset = ICON_SIZE / 2;
WAppIcon *aicon = NULL;
WAppIcon *nicon = NULL;
int max_y_icons, max_x_icons;
int max_y_icons;
/* TODO: XINERAMA, for these */
max_x_icons = scr->scr_width / ICON_SIZE;
max_y_icons = scr->scr_height / ICON_SIZE - 1;
if (wPreferences.flags.noupdates)

View File

@@ -22,6 +22,7 @@
#include "wconfig.h"
#ifdef HAVE_INOTIFY
#include <sys/select.h>
#include <sys/inotify.h>
#endif
@@ -29,6 +30,8 @@
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <strings.h>
#include <time.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>

View File

@@ -625,7 +625,7 @@ void wIconUpdate(WIcon * icon)
int x, y;
unsigned int w, h;
Window jw;
int ji, dotitle;
int ji;
unsigned int ju, d;
Pixmap pixmap;
@@ -646,7 +646,6 @@ void wIconUpdate(WIcon * icon)
if (icon->show_title && (title_height < wPreferences.icon_size)) {
drawIconTitle(scr, pixmap, title_height);
dotitle = 1;
if (h > wPreferences.icon_size - title_height - 2) {
h = wPreferences.icon_size - title_height - 2;
@@ -655,7 +654,6 @@ void wIconUpdate(WIcon * icon)
y = (wPreferences.icon_size - h - title_height) / 2 + title_height + 1;
}
} else {
dotitle = 0;
if (w > wPreferences.icon_size)
w = wPreferences.icon_size;
y = (wPreferences.icon_size - h) / 2;

View File

@@ -592,10 +592,9 @@ int main(int argc, char **argv)
static int real_main(int argc, char **argv)
{
int i, restart = 0;
int i;
char *pos;
int d, s;
int flag;
setlocale(LC_ALL, "");
wsetabort(wAbort);
@@ -603,7 +602,6 @@ static int real_main(int argc, char **argv)
/* for telling WPrefs what's the name of the wmaker binary being ran */
setenv("WMAKER_BIN_NAME", argv[0], 1);
flag = 0;
ArgCount = argc;
Arguments = wmalloc(sizeof(char *) * (ArgCount + 1));
for (i = 0; i < argc; i++) {
@@ -619,8 +617,6 @@ static int real_main(int argc, char **argv)
else
ProgName++;
restart = 0;
if (argc > 1) {
for (i = 1; i < argc; i++) {
#ifdef USECPP

View File

@@ -802,7 +802,7 @@ static void move_menus(WMenu * menu, int x, int y)
static void makeVisible(WMenu * menu)
{
WScreen *scr = menu->frame->screen_ptr;
int x1, y1, x2, y2, new_x, new_y, move;
int x1, y1, x2, y2, new_x, new_y;
WMRect rect = wGetRectForHead(scr, wGetHeadForPointerLocation(scr));
if (menu->entry_no < 0)
@@ -815,22 +815,17 @@ static void makeVisible(WMenu * menu)
new_x = x1;
new_y = y1;
move = 0;
if (x1 < rect.pos.x) {
new_x = rect.pos.x;
move = 1;
} else if (x2 >= rect.pos.x + rect.size.width) {
new_x = rect.pos.x + rect.size.width - MENUW(menu) - 1;
move = 1;
}
if (y1 < rect.pos.y) {
new_y = rect.pos.y;
move = 1;
} else if (y2 >= rect.pos.y + rect.size.height) {
new_y = rect.pos.y + rect.size.height - menu->entry_height - 1;
move = 1;
}
new_y = new_y - menu->frame->top_width - menu->selected_entry * menu->entry_height;

View File

@@ -26,6 +26,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <strings.h>
#include <unistd.h>
#include <stdarg.h>
#include <pwd.h>
@@ -92,14 +93,12 @@ static char *username(void)
char *MakeCPPArgs(char *path)
{
int i;
char buffer[MAXLINE], *buf, *line;
Visual *visual;
char *tmp;
line = wmalloc(MAXLINE);
*line = 0;
i = 1;
if ((buf = getenv("HOSTNAME")) != NULL) {
if (buf[0] == '(') {
wwarning(_("your machine is misconfigured. HOSTNAME is set to %s"), buf);

View File

@@ -902,14 +902,11 @@ updateWindowPosition(WWindow * wwin, MoveData * data, Bool doResistance,
int winL, winR, winT, winB; /* requested new window position */
int newX, newY; /* actual new window position */
Bool hresist, vresist;
Bool updateIndex;
Bool attract;
hresist = False;
vresist = False;
updateIndex = False;
/* check the direction of the movement */
dx = newMouseX - data->mouseX;
dy = newMouseY - data->mouseY;
@@ -1211,7 +1208,7 @@ int wKeyboardMoveResizeWindow(WWindow * wwin)
int done, off_x, off_y, ww, wh;
int kspeed = _KS;
Time lastTime = 0;
KeyCode shiftl, shiftr, ctrll, ctrlmode;
KeyCode shiftl, shiftr, ctrlmode;
KeySym keysym = NoSymbol;
int moment = 0;
int modes = ((IS_MOVABLE(wwin) ? MOVABLE_BIT : 0) | (IS_RESIZABLE(wwin) ? RESIZABLE_BIT : 0));
@@ -1221,7 +1218,6 @@ int wKeyboardMoveResizeWindow(WWindow * wwin)
shiftl = XKeysymToKeycode(dpy, XK_Shift_L);
shiftr = XKeysymToKeycode(dpy, XK_Shift_R);
ctrll = XKeysymToKeycode(dpy, XK_Control_L);
ctrlmode = done = off_x = off_y = 0;
if (modes == RESIZABLE_BIT) {
@@ -1851,7 +1847,6 @@ void wMouseResizeWindow(WWindow * wwin, XEvent * ev)
int rx1, ry1, rx2, ry2;
int res = 0;
KeyCode shiftl, shiftr;
int h = 0;
int orig_fx = fx;
int orig_fy = fy;
int orig_fw = fw;
@@ -1878,11 +1873,7 @@ void wMouseResizeWindow(WWindow * wwin, XEvent * ev)
ry2 = fy + fh - 1;
shiftl = XKeysymToKeycode(dpy, XK_Shift_L);
shiftr = XKeysymToKeycode(dpy, XK_Shift_R);
if (HAS_TITLEBAR(wwin))
h = WMFontHeight(wwin->screen_ptr->title_font) + (wPreferences.window_title_clearance +
TITLEBAR_EXTEND_SPACE) * 2;
else
h = 0;
while (1) {
WMMaskEvent(dpy, KeyPressMask | ButtonMotionMask
| ButtonReleaseMask | PointerMotionHintMask | ButtonPressMask | ExposureMask, &event);

View File

@@ -1,3 +1,10 @@
/*
* Until FreeBSD gets their act together;
* http://www.mail-archive.com/freebsd-hackers@freebsd.org/msg69469.html
*/
#if defined( FREEBSD )
# undef _XOPEN_SOURCE
#endif
#if defined( FREEBSD ) || defined( DRAGONFLYBSD )
# include <sys/types.h>

View File

@@ -29,6 +29,7 @@
#include <sys/wait.h>
#include <sys/types.h>
#include <string.h>
#include <strings.h>
#include <ctype.h>
#include <time.h>
#include <dirent.h>
@@ -1151,7 +1152,7 @@ static WMenu *readMenuFile(WScreen * scr, char *file_name)
}
}
#ifdef CPP
#ifdef USECPP
if (cpp) {
if (pclose(file) == -1) {
werror(_("error reading preprocessed menu data"));
@@ -1183,7 +1184,6 @@ static WMenu *readMenuPipe(WScreen * scr, char **file_name)
int i;
#ifdef USECPP
char *args;
int cpp = 0;
#endif
flat_file[0] = '\0';
@@ -1206,8 +1206,6 @@ static WMenu *readMenuPipe(WScreen * scr, char **file_name)
file = popen(command, "r");
if (!file) {
werror(_("%s:could not open/preprocess menu file"), filename);
} else {
cpp = 1;
}
}
}

View File

@@ -65,6 +65,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <strings.h>
#include <unistd.h>
#include <time.h>

View File

@@ -25,6 +25,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <strings.h>
#include <ctype.h>
#include <X11/Xlib.h>

View File

@@ -27,6 +27,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <strings.h>
#include "WindowMaker.h"
#include "screen.h"

View File

@@ -647,12 +647,11 @@ static void newWSCommand(WMenu * menu, WMenuEntry * foo)
static char *cropline(char *line)
{
char *start, *end;
char *end;
if (strlen(line) == 0)
return line;
start = line;
end = &(line[strlen(line)]) - 1;
while (isspace(*line) && *line != 0)
line++;
@@ -821,7 +820,7 @@ void wWorkspaceSaveState(WScreen * scr, WMPropList * old_state)
void wWorkspaceRestoreState(WScreen * scr)
{
WMPropList *parr, *pstr, *wks_state, *clip_state;
int i, j, wscount;
int i, j;
make_keys();
@@ -833,7 +832,6 @@ void wWorkspaceRestoreState(WScreen * scr)
if (!parr)
return;
wscount = scr->workspace_count;
for (i = 0; i < WMIN(WMGetPropListItemCount(parr), MAX_WORKSPACES); i++) {
wks_state = WMGetFromPLArray(parr, i);
if (WMIsPLDictionary(wks_state))

View File

@@ -30,6 +30,7 @@ Perpetrator: Sudish Joseph <sj@eng.mindspring.net>, Sept. 1997. */
#include "wconfig.h"
#include <string.h>
#include <strings.h>
#include <X11/Xlib.h>
#include <X11/keysym.h>
@@ -111,9 +112,6 @@ static const char *index_to_name(int indice)
static void x_reset_modifier_mapping(Display * display)
{
int modifier_index, modifier_key, column, mkpm;
int warned_about_overlapping_modifiers = 0;
int warned_about_predefined_modifiers = 0;
int warned_about_duplicate_modifiers = 0;
int meta_bit = 0;
int hyper_bit = 0;
int super_bit = 0;
@@ -123,26 +121,22 @@ static void x_reset_modifier_mapping(Display * display)
#define modwarn(name,old,other) \
wwarning ("%s (0x%x) generates %s, which is generated by %s.", \
name, code, index_to_name (old), other), \
warned_about_overlapping_modifiers = 1
name, code, index_to_name (old), other)
#define modbarf(name,other) \
wwarning ("%s (0x%x) generates %s, which is nonsensical.", \
name, code, other), \
warned_about_predefined_modifiers = 1
name, code, other)
#define check_modifier(name,mask) \
if ((1<<modifier_index) != mask) \
wwarning ("%s (0x%x) generates %s, which is nonsensical.", \
name, code, index_to_name (modifier_index)), \
warned_about_predefined_modifiers = 1
name, code, index_to_name (modifier_index))
#define store_modifier(name,old) \
if (old && old != modifier_index) \
wwarning ("%s (0x%x) generates both %s and %s, which is nonsensical.", \
name, code, index_to_name (old), \
index_to_name (modifier_index)), \
warned_about_duplicate_modifiers = 1; \
index_to_name (modifier_index)); \
if (modifier_index == ShiftMapIndex) modbarf (name,"ModShift"); \
else if (modifier_index == LockMapIndex) modbarf (name,"ModLock"); \
else if (modifier_index == ControlMapIndex) modbarf (name,"ModControl"); \
@@ -254,7 +248,7 @@ static void x_reset_modifier_mapping(Display * display)
warn = "Alt", alt_bit = 0;
if (warn) {
wwarning("%s is being used for both Mode_switch and %s.",
index_to_name(mode_bit), warn), warned_about_overlapping_modifiers = 1;
index_to_name(mode_bit), warn);
}
}
@@ -264,35 +258,6 @@ static void x_reset_modifier_mapping(Display * display)
AltMask = (alt_bit ? (1 << alt_bit) : 0);
ModeMask = (mode_bit ? (1 << mode_bit) : 0); /* unused */
#if 0
if (warned_about_overlapping_modifiers)
wwarning("\n"
" Two distinct modifier keys (such as Meta and Hyper) cannot generate\n"
" the same modifier bit, because Emacs won't be able to tell which\n"
" modifier was actually held down when some other key is pressed. It\n"
" won't be able to tell Meta-x and Hyper-x apart, for example. Change\n"
" one of these keys to use some other modifier bit. If you intend for\n"
" these keys to have the same behavior, then change them to have the\n"
" same keysym as well as the same modifier bit.\n");
if (warned_about_predefined_modifiers)
wwarning("\n"
" The semantics of the modifier bits ModShift, ModLock, and ModControl\n"
" are predefined. It does not make sense to assign ModControl to any\n"
" keysym other than Control_L or Control_R, or to assign any modifier\n"
" bits to the \"control\" keysyms other than ModControl. You can't\n"
" turn a \"control\" key into a \"meta\" key (or vice versa) by simply\n"
" assigning the key a different modifier bit. You must also make that\n"
" key generate an appropriate keysym (Control_L, Meta_L, etc).\n");
/* No need to say anything more for warned_about_duplicate_modifiers. */
if (warned_about_overlapping_modifiers || warned_about_predefined_modifiers)
wwarning("\n"
" The meanings of the modifier bits Mod1 through Mod5 are determined\n"
" by the keysyms used to control those bits. Mod1 does NOT always\n"
" mean Meta, although some non-ICCCM-compliant programs assume that.\n");
#endif
XFreeModifiermap(x_modifier_keymap);
}

View File

@@ -35,6 +35,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <unistd.h>
#include <WINGs/WUtil.h>
@@ -216,7 +217,7 @@ void copyFile(char *dir, char *file)
break;
RETRY( nwritten = fwrite(buf, 1, nread, dst) )
if (ferror(dst) || feof(src))
if (ferror(dst) || feof(src) || nread != nwritten)
break;
} while (1);

View File

@@ -48,7 +48,7 @@ void print_help(int print_usage, int exitval)
int main(int argc, char **argv)
{
WMPropList *window_name, *icon_key, *window_attrs, *icon_value;
WMPropList *window_name, *window_attrs, *icon_value;
WMPropList *all_windows, *iconset, *keylist;
int i, ch;
char *path = NULL;
@@ -96,7 +96,6 @@ int main(int argc, char **argv)
}
keylist = WMGetPLDictionaryKeys(iconset);
icon_key = WMCreatePLString("Icon");
for (i = 0; i < WMGetPropListItemCount(keylist); i++) {
window_name = WMGetFromPLArray(keylist, i);

View File

@@ -30,6 +30,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <unistd.h>
#include <X11/Xlib.h>

View File

@@ -56,7 +56,7 @@ void print_help(int print_usage, int exitval)
int main(int argc, char **argv)
{
char path[PATH_MAX];
WMPropList *dom, *key, *value, *dict;
WMPropList *key, *value, *dict;
int ch;
struct option longopts[] = {
@@ -87,7 +87,6 @@ int main(int argc, char **argv)
if (argc != 3)
print_help(0, 1);
dom = WMCreatePLString(argv[0]);
key = WMCreatePLString(argv[1]);
value = WMCreatePropListFromDescription(argv[2]);
if (!value) {

View File

@@ -397,7 +397,6 @@ static BufferData *newWindow(int magfactor)
int main(int argc, char **argv)
{
BufferData *data;
int i;
char *display = "";
char *vdisplay = NULL;
@@ -481,8 +480,6 @@ int main(int argc, char **argv)
cursorColor1 = WMCreateNamedColor(scr, "#ff0000", False);
cursorColor2 = WMCreateNamedColor(scr, "#00ff00", False);
data = newWindow(magfactor);
WMScreenMainLoop(scr);
return 0;

View File

@@ -4,6 +4,7 @@
#define _GNU_SOURCE /* getopt_long */
#endif
#include <ctype.h>
#include <getopt.h>
#include <limits.h>
#include <locale.h>

View File

@@ -18,12 +18,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#if __GLIBC__ && \
(_XOPEN_SOURCE && _XOPEN_SOURCE < 500) || \
!_XOPEN_SOURCE
#define _XOPEN_SOURCE 500 /* nftw */
#endif
#include <sys/types.h>
#include <sys/stat.h>

View File

@@ -20,12 +20,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#if __GLIBC__ && \
(_XOPEN_SOURCE && _XOPEN_SOURCE < 500) || \
!_XOPEN_SOURCE
#define _XOPEN_SOURCE 500 /* nftw */
#endif
#include <sys/types.h>
#include <sys/stat.h>

View File

@@ -36,12 +36,6 @@
* Basic validation of the .desktop file is done.
*/
#if __GLIBC__ && \
(_XOPEN_SOURCE && _XOPEN_SOURCE < 500) || \
!_XOPEN_SOURCE
#define _XOPEN_SOURCE 500 /* nftw */
#endif
#include <sys/types.h>
#include <sys/stat.h>

View File

@@ -31,6 +31,7 @@
#include <X11/Xutil.h>
#include <X11/Xatom.h>
#include <string.h>
#include <strings.h>
#include <pwd.h>
#include <signal.h>
#include <sys/types.h>