Bug 1250396 (part 2) - Remove nsStaticAtomStringType. r=froydnj.

It's only used in one file and obscures more than it enlightens.
This commit is contained in:
Nicholas Nethercote 2016-02-23 16:55:59 +11:00
parent 85d2dc6c54
commit 2f88a9a04e

View File

@ -11,10 +11,12 @@
#include "nsStringBuffer.h" #include "nsStringBuffer.h"
#include "mozilla/Logging.h" #include "mozilla/Logging.h"
typedef char16_t nsStaticAtomStringType; #define NS_STATIC_ATOM(buffer_name, atom_ptr) \
{ (nsStringBuffer*) &buffer_name, atom_ptr }
#define NS_STATIC_ATOM(buffer_name, atom_ptr) { (nsStringBuffer*) &buffer_name, atom_ptr } #define NS_STATIC_ATOM_BUFFER(buffer_name, str_data) \
#define NS_STATIC_ATOM_BUFFER(buffer_name, str_data) static nsFakeStringBuffer< sizeof(str_data) > buffer_name = { 1, sizeof(str_data) * sizeof(nsStaticAtomStringType), MOZ_UTF16(str_data) }; static nsFakeStringBuffer<sizeof(str_data)> buffer_name = \
{ 1, sizeof(str_data) * sizeof(char16_t), MOZ_UTF16(str_data) };
/** /**
* Holds data used to initialize large number of atoms during startup. Use * Holds data used to initialize large number of atoms during startup. Use
@ -37,7 +39,7 @@ struct nsFakeStringBuffer
{ {
int32_t mRefCnt; int32_t mRefCnt;
uint32_t mSize; uint32_t mSize;
nsStaticAtomStringType mStringData[size]; char16_t mStringData[size];
}; };
// Register an array of static atoms with the atom table // Register an array of static atoms with the atom table