mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 06:11:37 +00:00
Bug 997026 - Part 1: Fix clang -Wunused-const-variable warnings in xpcom. r=froydnj
This commit is contained in:
parent
36eabab2d0
commit
4209aa8513
@ -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);
|
||||
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user