mirror of
https://github.com/gryf/wmaker.git
synced 2026-02-20 16:55:46 +01:00
WINGs: Marked args as unused for compiler in XDND callback code
The drag-n-drop mechanism is managed by WINGs through callbacks, which means having a fixed argument list for the handling function. It is then correct to not use all the arguments, so this patch adds the appropriate stuff to avoid a false report from compiler. Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
committed by
Carlos R. Mafra
parent
fed1bf4de3
commit
0d8a530bc3
@@ -407,6 +407,12 @@ storeDropData(WMView * destView, Atom selection, Atom target, Time timestamp, vo
|
|||||||
WMDraggingInfo *info = &(scr->dragInfo);
|
WMDraggingInfo *info = &(scr->dragInfo);
|
||||||
WMData *dataToStore = NULL;
|
WMData *dataToStore = NULL;
|
||||||
|
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) selection;
|
||||||
|
(void) target;
|
||||||
|
(void) timestamp;
|
||||||
|
(void) cdata;
|
||||||
|
|
||||||
if (data != NULL)
|
if (data != NULL)
|
||||||
dataToStore = WMRetainData(data);
|
dataToStore = WMRetainData(data);
|
||||||
|
|
||||||
@@ -888,6 +894,11 @@ void WMUnregisterViewDraggedTypes(WMView * view)
|
|||||||
static WMDragOperationType
|
static WMDragOperationType
|
||||||
defAllowedOperation(WMView * self, WMDragOperationType requestedOperation, WMArray * sourceDataTypes)
|
defAllowedOperation(WMView * self, WMDragOperationType requestedOperation, WMArray * sourceDataTypes)
|
||||||
{
|
{
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) self;
|
||||||
|
(void) requestedOperation;
|
||||||
|
(void) sourceDataTypes;
|
||||||
|
|
||||||
/* no operation allowed */
|
/* no operation allowed */
|
||||||
return WDOperationNone;
|
return WDOperationNone;
|
||||||
}
|
}
|
||||||
@@ -903,6 +914,11 @@ defAllowedOperation(WMView * self, WMDragOperationType requestedOperation, WMArr
|
|||||||
static WMArray *defRequiredDataTypes(WMView * self,
|
static WMArray *defRequiredDataTypes(WMView * self,
|
||||||
WMDragOperationType requestedOperation, WMArray * sourceDataTypes)
|
WMDragOperationType requestedOperation, WMArray * sourceDataTypes)
|
||||||
{
|
{
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) self;
|
||||||
|
(void) requestedOperation;
|
||||||
|
(void) sourceDataTypes;
|
||||||
|
|
||||||
/* no data type allowed (NULL even at 2nd pass) */
|
/* no data type allowed (NULL even at 2nd pass) */
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -912,6 +928,8 @@ static WMArray *defRequiredDataTypes(WMView * self,
|
|||||||
*/
|
*/
|
||||||
static void defPrepareForDragOperation(WMView * self)
|
static void defPrepareForDragOperation(WMView * self)
|
||||||
{
|
{
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) self;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -938,11 +956,18 @@ static void defPrepareForDragOperation(WMView * self)
|
|||||||
static void
|
static void
|
||||||
defPerformDragOperation(WMView * self, WMArray * dropDatas, WMArray * operationList, WMPoint * dropLocation)
|
defPerformDragOperation(WMView * self, WMArray * dropDatas, WMArray * operationList, WMPoint * dropLocation)
|
||||||
{
|
{
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) self;
|
||||||
|
(void) dropDatas;
|
||||||
|
(void) operationList;
|
||||||
|
(void) dropLocation;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Executed after drop */
|
/* Executed after drop */
|
||||||
static void defConcludeDragOperation(WMView * self)
|
static void defConcludeDragOperation(WMView * self)
|
||||||
{
|
{
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) self;
|
||||||
}
|
}
|
||||||
|
|
||||||
void WMSetViewDragDestinationProcs(WMView * view, WMDragDestinationProcs * procs)
|
void WMSetViewDragDestinationProcs(WMView * view, WMDragDestinationProcs * procs)
|
||||||
|
|||||||
@@ -132,6 +132,10 @@ static WMData *convertSelection(WMView * view, Atom selection, Atom target, void
|
|||||||
WMData *data;
|
WMData *data;
|
||||||
char *typeName;
|
char *typeName;
|
||||||
|
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) selection;
|
||||||
|
(void) cdata;
|
||||||
|
|
||||||
scr = W_VIEW_SCREEN(view);
|
scr = W_VIEW_SCREEN(view);
|
||||||
typeName = XGetAtomName(scr->display, target);
|
typeName = XGetAtomName(scr->display, target);
|
||||||
|
|
||||||
@@ -151,11 +155,22 @@ static WMData *convertSelection(WMView * view, Atom selection, Atom target, void
|
|||||||
|
|
||||||
static void selectionLost(WMView * view, Atom selection, void *cdata)
|
static void selectionLost(WMView * view, Atom selection, void *cdata)
|
||||||
{
|
{
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) view;
|
||||||
|
(void) selection;
|
||||||
|
(void) cdata;
|
||||||
|
|
||||||
wwarning("DND selection lost during drag operation...");
|
wwarning("DND selection lost during drag operation...");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void selectionDone(WMView * view, Atom selection, Atom target, void *cdata)
|
static void selectionDone(WMView * view, Atom selection, Atom target, void *cdata)
|
||||||
{
|
{
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) view;
|
||||||
|
(void) selection;
|
||||||
|
(void) target;
|
||||||
|
(void) cdata;
|
||||||
|
|
||||||
#ifdef XDND_DEBUG
|
#ifdef XDND_DEBUG
|
||||||
printf("selection done\n");
|
printf("selection done\n");
|
||||||
#endif
|
#endif
|
||||||
@@ -542,11 +557,17 @@ static void initSourceDragInfo(WMView * sourceView, WMDraggingInfo * info)
|
|||||||
*/
|
*/
|
||||||
static WMArray *defDropDataTypes(WMView * self)
|
static WMArray *defDropDataTypes(WMView * self)
|
||||||
{
|
{
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) self;
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static WMDragOperationType defWantedDropOperation(WMView * self)
|
static WMDragOperationType defWantedDropOperation(WMView * self)
|
||||||
{
|
{
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) self;
|
||||||
|
|
||||||
return WDOperationNone;
|
return WDOperationNone;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -560,15 +581,26 @@ static WMDragOperationType defWantedDropOperation(WMView * self)
|
|||||||
|
|
||||||
static Bool defAcceptDropOperation(WMView * self, WMDragOperationType allowedOperation)
|
static Bool defAcceptDropOperation(WMView * self, WMDragOperationType allowedOperation)
|
||||||
{
|
{
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) self;
|
||||||
|
(void) allowedOperation;
|
||||||
|
|
||||||
return False;
|
return False;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void defBeganDrag(WMView * self, WMPoint * point)
|
static void defBeganDrag(WMView * self, WMPoint * point)
|
||||||
{
|
{
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) self;
|
||||||
|
(void) point;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void defEndedDrag(WMView * self, WMPoint * point, Bool deposited)
|
static void defEndedDrag(WMView * self, WMPoint * point, Bool deposited)
|
||||||
{
|
{
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) self;
|
||||||
|
(void) point;
|
||||||
|
(void) deposited;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -576,6 +608,10 @@ static void defEndedDrag(WMView * self, WMPoint * point, Bool deposited)
|
|||||||
*/
|
*/
|
||||||
static WMData *defFetchDragData(WMView * self, char *type)
|
static WMData *defFetchDragData(WMView * self, char *type)
|
||||||
{
|
{
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) self;
|
||||||
|
(void) type;
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -279,11 +279,17 @@ static WMArray *dropDataTypes(WMView * self)
|
|||||||
|
|
||||||
static WMDragOperationType wantedDropOperation(WMView * self)
|
static WMDragOperationType wantedDropOperation(WMView * self)
|
||||||
{
|
{
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) self;
|
||||||
|
|
||||||
return WDOperationCopy;
|
return WDOperationCopy;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Bool acceptDropOperation(WMView * self, WMDragOperationType operation)
|
static Bool acceptDropOperation(WMView * self, WMDragOperationType operation)
|
||||||
{
|
{
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) self;
|
||||||
|
|
||||||
return (operation == WDOperationCopy);
|
return (operation == WDOperationCopy);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -292,6 +298,9 @@ static WMData *fetchDragData(WMView * self, char *type)
|
|||||||
char *color = WMGetColorRGBDescription(((WMColorWell *) self->self)->color);
|
char *color = WMGetColorRGBDescription(((WMColorWell *) self->self)->color);
|
||||||
WMData *data;
|
WMData *data;
|
||||||
|
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) type;
|
||||||
|
|
||||||
data = WMCreateDataWithBytes(color, strlen(color) + 1);
|
data = WMCreateDataWithBytes(color, strlen(color) + 1);
|
||||||
wfree(color);
|
wfree(color);
|
||||||
|
|
||||||
@@ -388,6 +397,9 @@ static WMArray *requiredDataTypes(WMView * self, WMDragOperationType request, WM
|
|||||||
|
|
||||||
static WMDragOperationType allowedOperation(WMView * self, WMDragOperationType request, WMArray * sourceDataTypes)
|
static WMDragOperationType allowedOperation(WMView * self, WMDragOperationType request, WMArray * sourceDataTypes)
|
||||||
{
|
{
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) self;
|
||||||
|
|
||||||
if (dropIsOk(request, sourceDataTypes))
|
if (dropIsOk(request, sourceDataTypes))
|
||||||
return WDOperationCopy;
|
return WDOperationCopy;
|
||||||
else
|
else
|
||||||
@@ -400,6 +412,10 @@ static void performDragOperation(WMView * self, WMArray * dropData, WMArray * op
|
|||||||
WMColor *color;
|
WMColor *color;
|
||||||
WMData *data;
|
WMData *data;
|
||||||
|
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) operations;
|
||||||
|
(void) dropLocation;
|
||||||
|
|
||||||
/* only one operation requested (WDOperationCopy) implies only one data */
|
/* only one operation requested (WDOperationCopy) implies only one data */
|
||||||
data = (WMData *) WMGetFromArray(dropData, 0);
|
data = (WMData *) WMGetFromArray(dropData, 0);
|
||||||
|
|
||||||
|
|||||||
@@ -2703,11 +2703,17 @@ static WMArray *dropDataTypes(WMView * self)
|
|||||||
|
|
||||||
static WMDragOperationType wantedDropOperation(WMView * self)
|
static WMDragOperationType wantedDropOperation(WMView * self)
|
||||||
{
|
{
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) self;
|
||||||
|
|
||||||
return WDOperationCopy;
|
return WDOperationCopy;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Bool acceptDropOperation(WMView * self, WMDragOperationType allowedOperation)
|
static Bool acceptDropOperation(WMView * self, WMDragOperationType allowedOperation)
|
||||||
{
|
{
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) self;
|
||||||
|
|
||||||
return (allowedOperation == WDOperationCopy);
|
return (allowedOperation == WDOperationCopy);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2746,11 +2752,20 @@ static WMDragSourceProcs _DragSourceProcs = {
|
|||||||
|
|
||||||
static WMArray *requiredDataTypes(WMView * self, WMDragOperationType request, WMArray * sourceDataTypes)
|
static WMArray *requiredDataTypes(WMView * self, WMDragOperationType request, WMArray * sourceDataTypes)
|
||||||
{
|
{
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) request;
|
||||||
|
(void) sourceDataTypes;
|
||||||
|
|
||||||
return ((Text *) self->self)->xdndDestinationTypes;
|
return ((Text *) self->self)->xdndDestinationTypes;
|
||||||
}
|
}
|
||||||
|
|
||||||
static WMDragOperationType allowedOperation(WMView * self, WMDragOperationType request, WMArray * sourceDataTypes)
|
static WMDragOperationType allowedOperation(WMView * self, WMDragOperationType request, WMArray * sourceDataTypes)
|
||||||
{
|
{
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) self;
|
||||||
|
(void) request;
|
||||||
|
(void) sourceDataTypes;
|
||||||
|
|
||||||
return WDOperationCopy;
|
return WDOperationCopy;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2761,6 +2776,10 @@ static void performDragOperation(WMView * self, WMArray * dropData, WMArray * op
|
|||||||
char *colorName;
|
char *colorName;
|
||||||
WMColor *color;
|
WMColor *color;
|
||||||
|
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) operations;
|
||||||
|
(void) dropLocation;
|
||||||
|
|
||||||
if (tPtr) {
|
if (tPtr) {
|
||||||
|
|
||||||
/* only one required type, implies only one drop data */
|
/* only one required type, implies only one drop data */
|
||||||
|
|||||||
Reference in New Issue
Block a user