Bug 997026 - Part 1: Fix clang -Wunused-const-variable warnings in xpcom. r=froydnj

This commit is contained in:
Chris Peterson 2014-04-15 00:24:13 -07:00
parent a9f4bca02b
commit 872843a612
2 changed files with 8 additions and 13 deletions

View File

@ -2,17 +2,11 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsID.h"
#include "prprf.h"
#include "nsMemory.h"
static const char gIDFormat[] =
"{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}";
static const char gIDFormat2[] =
"%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x";
/**
* Multiplies the_int_var with 16 (0x10) and adds the value of the
* hexadecimal digit the_char. If it fails it returns false from
@ -51,8 +45,8 @@ static const char gIDFormat2[] =
*/
#define PARSE_HYPHEN(char_pointer) if(*(char_pointer++) != '-') return false
/*
/*
* Turns a {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} string into
* an nsID. It can also handle the old format without the { and }.
*/
@ -81,19 +75,22 @@ bool nsID::Parse(const char *aIDStr)
PARSE_CHARS_TO_NUM(aIDStr, m3[i], 2);
i++;
}
return expectFormat1 ? *aIDStr == '}' : true;
}
#ifndef XPCOM_GLUE_AVOID_NSPR
static const char gIDFormat[] =
"{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}";
/*
* Returns an allocated string in {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
* format. The string is allocated with NS_Alloc and should be freed by
* the caller.
*/
char *nsID::ToString() const
char *nsID::ToString() const
{
char *res = (char*)NS_Alloc(NSID_LENGTH);

View File

@ -17,7 +17,6 @@
*/
static const int32_t kMinGrowArrayBy = 8;
static const int32_t kMaxGrowArrayBy = 1024;
static const int32_t kAutoClearCompactSizeFactor = 4;
/**
* This is the threshold (in bytes) of the mImpl struct, past which
@ -31,7 +30,6 @@ static const int32_t kLinearThreshold = 24 * sizeof(void *);
*/
#define SIZEOF_IMPL(n_) (sizeof(Impl) + sizeof(void *) * ((n_) - 1))
/**
* Compute the number of elements that an mImpl struct of |n| bytes
* will hold.