mirror of
https://github.com/gryf/wmaker.git
synced 2026-02-10 02:25:46 +01:00
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:
committed by
Carlos R. Mafra
parent
43c7abe79f
commit
f65b99e615
@@ -16,6 +16,7 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include <unistd.h>
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <X11/Xft/Xft.h>
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user