gcc 4.6 complains about "set but unused" variables by default with -Werror.
Fix the code that triggers that warning. Also sneak in a fix to
rpcgen_wrapper.sh.
Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
Unicode bas;
UnicodeIndex volEnd;
UnicodeIndex length;
- UnicodeIndex pathLen;
UnicodeIndex baseBegin;
+ WIN32_ONLY(UnicodeIndex pathLen);
ASSERT(pathName);
- pathLen = Unicode_LengthInCodePoints(pathName);
-
/*
* Get volume.
*/
volEnd = 0;
#if defined(_WIN32)
+ pathLen = Unicode_LengthInCodePoints(pathName);
if ((pathLen > 2) &&
(Unicode_StartsWith(pathName, "\\\\") ||
Unicode_StartsWith(pathName, "//"))) {
* each search, if its base name is no longer within a share, remove it.
*/
for (i = 0; i < session->numSearches; i++) {
- HgfsHandle handle;
DblLnkLst_Links *l;
if (DblLnkLst_IsLinked(&session->searchArray[i].links)) {
continue;
}
- handle = HgfsSearch2SearchHandle(&session->searchArray[i]);
LOG(4, ("%s: Examining search (%s)\n", __FUNCTION__,
session->searchArray[i].utf8Dir));
ASSERT(cpName);
inEnd = cpName + cpNameSize;
-
len = CPName_GetComponent(cpName, inEnd, &next);
+
ASSERT(len > 0);
+ (void) len; /* Shuts up gcc's -Werror=unused-but-set-variable. */
return (next == inEnd);
}
HgfsSendFlags flags) // IN: Flags to say how to process
{
HgfsGuestConn *connData = conn;
- unsigned char *packetOut = &connData->packetOut[0];
ASSERT(NULL != connData);
ASSERT(NULL != packet);
ASSERT(bufferLen <= HGFS_LARGE_PACKET_MAX &&
bufferLen <= packet->replyPacketSize);
- if (connData->clientPacketOut != NULL) {
- /* Client passed us an out buffer so use it. */
- packetOut = connData->clientPacketOut;
- }
ASSERT(bufferLen <= connData->packetOutLen);
if (bufferLen > connData->packetOutLen) {
bufferLen = connData->packetOutLen;
void *newNative = VThreadBaseGetNative();
HashTable *ht = VThreadBaseGetNativeHash();
VThreadBaseData *base;
- VThreadBaseKeyType key;
/* Require key allocation before TLS read */
- key = VThreadBaseGetKey();
+ VThreadBaseGetKey();
/* Before allocating a new ID, try to reclaim any old IDs. */
for (newID = 0;
newKey = (void *)(uintptr_t)newID;
result = HashTable_Insert(ht, newKey, newNative);
- ASSERT(result);
+ ASSERT_NOT_IMPLEMENTED(result);
}
/* ID picked. Now do the important stuff. */
char const *errmsg;
char const *reply;
size_t repLen;
- Bool resched = FALSE;
+
+#if defined(VMTOOLS_USE_GLIB)
unsigned int current;
+ Bool resched = FALSE;
+#endif
in = (RpcIn *)clientData;
ASSERT(in);
ASSERT(in->channel);
ASSERT(in->mustSend);
-#if !defined(VMTOOLS_USE_GLIB)
+#if defined(VMTOOLS_USE_GLIB)
+ current = in->delay;
+#else
/*
* The event has fired: it is no longer valid. Note that this is
* not true in the glib case!
in->inLoop = TRUE;
- current = in->delay;
-
/*
* This is very important: this is the only way to signal the existence of
* this guest application to VMware.
if (in->shouldStop) {
RpcInStop(in);
in->shouldStop = FALSE;
+#if defined(VMTOOLS_USE_GLIB)
/* Force the GMainContext to unref the GSource that runs the RpcIn loop. */
resched = TRUE;
+#endif
}
in->inLoop = FALSE;
int n, n2; /* handy integer (short term usage) */
char *cp; /* handy char pointer (short term usage) */
int flags; /* flags as above */
- int width; /* width from format (%8d), or 0 */
enum typeid *typetable; /* table of types */
enum typeid stattypetable [STATIC_ARG_TBL_SIZE];
int tablesize; /* current size of type table */
fmt++; /* skip over '%' */
flags = 0;
- width = 0;
rflag: ch = *fmt++;
reswitch: switch (ch) {
nextarg = n;
goto rflag;
}
- width = n;
goto reswitch;
case 'h':
if (flags & SHORTINT) {
int n, n2; /* handy integer (short term usage) */
wchar_t *cp; /* handy char pointer (short term usage) */
int flags; /* flags as above */
- int width; /* width from format (%8d), or 0 */
enum typeid *typetable; /* table of types */
enum typeid stattypetable [STATIC_ARG_TBL_SIZE];
int tablesize; /* current size of type table */
fmt++; /* skip over '%' */
flags = 0;
- width = 0;
rflag: ch = *fmt++;
reswitch: switch (ch) {
nextarg = n;
goto rflag;
}
- width = n;
goto reswitch;
case 'h':
if (flags & SHORTINT) {
#else
(void) wiperData;
success = Wiper_Init(NULL);
- ASSERT(success);
+ ASSERT_NOT_IMPLEMENTED(success);
#endif
}
case $output in
- *.h) do_header ;;
- *.c) do_impl ;;
+ *.h) do_header "$@" ;;
+ *.c) do_impl "$@" ;;
*) echo "Unknown output file type: $output" ;;
esac
size_t resultBufferSize = 0;
size_t lastGoodResultBufferSize = 0;
int numFiles = 0;
- int lastGoodNumFiles = 0;
int fileNum;
char *currentFileName;
char *destPtr;
}
if (resultBufferSize < maxBufferSize) {
- /*
- * lastGoodNumFiles is a count (1 based), while fileNum is
- * an array index (zero based). So lastGoodNumFiles is
- * fileNum + 1.
- */
- lastGoodNumFiles = fileNum + 1;
lastGoodResultBufferSize = resultBufferSize;
} else {
truncated = TRUE;
int64 tempTime;
Bool timeAttributeSpecified = FALSE;
Bool windowsAttributeSpecified = FALSE;
- Bool posixAttributeSpecified = FALSE;
int32 fileAttributeOptions = 0;
#ifdef _WIN32
fileAttributeOptions = setGuestFileAttributesRequest->fileOptions;
- if ((fileAttributeOptions & VIX_FILE_ATTRIBUTE_SET_UNIX_OWNERID) ||
- (fileAttributeOptions & VIX_FILE_ATTRIBUTE_SET_UNIX_GROUPID) ||
- (fileAttributeOptions & VIX_FILE_ATTRIBUTE_SET_UNIX_PERMISSIONS)) {
- posixAttributeSpecified = TRUE;
- }
-
if ((fileAttributeOptions & VIX_FILE_ATTRIBUTE_SET_HIDDEN) ||
(fileAttributeOptions & VIX_FILE_ATTRIBUTE_SET_READONLY)) {
windowsAttributeSpecified = TRUE;
}
#if defined(_WIN32)
- if (posixAttributeSpecified) {
+ if ((fileAttributeOptions & VIX_FILE_ATTRIBUTE_SET_UNIX_OWNERID) ||
+ (fileAttributeOptions & VIX_FILE_ATTRIBUTE_SET_UNIX_GROUPID) ||
+ (fileAttributeOptions & VIX_FILE_ATTRIBUTE_SET_UNIX_PERMISSIONS)) {
Debug("%s: Invalid attributes received for Windows Guest\n",
__FUNCTION__);
err = VIX_E_INVALID_ARG;
ASSERT(suite != NULL);
test = CU_add_test(suite, g_module_name(gPlugin), RpcDebugRunLoop);
- ASSERT(test != NULL);
+ ASSERT_NOT_IMPLEMENTED(test != NULL);
gLibRunData.ctx = ctx;
gLibRunData.libData = ldata;
char *ptrStr, *logInpFilename, *ver;
int version;
int filenu = 0; // output file enumerator
- extractMode state = NOT_IN_GUEST_LOGGING;
+ DEBUG_ONLY(extractMode state = NOT_IN_GUEST_LOGGING);
if (!(fp = fopen(filename, "rt"))) {
ASSERT(outfp == NULL);
ASSERT(state == NOT_IN_GUEST_LOGGING);
- state = IN_GUEST_LOGGING;
+ DEBUG_ONLY(state = IN_GUEST_LOGGING);
/*
* read the input filename, which was the filename written by the
}
} else if (strstr(buf, LOG_END_MARK)) { // close the output file.
ASSERT(state == IN_GUEST_LOGGING);
- state = NOT_IN_GUEST_LOGGING;
+ DEBUG_ONLY(state = NOT_IN_GUEST_LOGGING);
fclose(outfp);
outfp = NULL;
} else { // write to the output file