constification of static strings in mork. Bug Bug 209226, patch by
ataylor@its.to (Andrew Taylor), r/sr=alecf, sr=bzbarsky.
This commit is contained in:
Родитель
1b55c34026
Коммит
9fad7154b6
|
@ -292,7 +292,7 @@ mork_size
|
|||
morkEnv::TokenAsHex(void* outBuf, mork_token inToken)
|
||||
// TokenAsHex() is the same as sprintf(outBuf, "%lX", (long) inToken);
|
||||
{
|
||||
static const char* morkEnv_kHexDigits = "0123456789ABCDEF";
|
||||
static const char morkEnv_kHexDigits[] = "0123456789ABCDEF";
|
||||
char* p = (char*) outBuf;
|
||||
char* end = p + 32; // write no more than 32 digits for safety
|
||||
if ( inToken )
|
||||
|
@ -439,7 +439,7 @@ morkEnv::CantMakeWhenBadError()
|
|||
this->NewError("can't make an object when ev->Bad()");
|
||||
}
|
||||
|
||||
static const char* morkEnv_kNilPointer = "nil pointer";
|
||||
static const char morkEnv_kNilPointer[] = "nil pointer";
|
||||
|
||||
void
|
||||
morkEnv::NilPointerError()
|
||||
|
|
|
@ -269,17 +269,17 @@ morkFile::NewFileErrnoError(morkEnv* ev) const
|
|||
// ````` ````` ````` ````` newlines ````` ````` ````` `````
|
||||
|
||||
#if defined(MORK_MAC)
|
||||
static const char* morkFile_kNewlines =
|
||||
static const char morkFile_kNewlines[] =
|
||||
"\015\015\015\015\015\015\015\015\015\015\015\015\015\015\015\015";
|
||||
# define morkFile_kNewlinesCount 16
|
||||
#else
|
||||
# if defined(MORK_WIN) || defined(MORK_OS2)
|
||||
static const char* morkFile_kNewlines =
|
||||
static const char morkFile_kNewlines[] =
|
||||
"\015\012\015\012\015\012\015\012\015\012\015\012\015\012\015\012";
|
||||
# define morkFile_kNewlinesCount 8
|
||||
# else
|
||||
# if defined(MORK_UNIX) || defined(MORK_BEOS)
|
||||
static const char* morkFile_kNewlines =
|
||||
static const char morkFile_kNewlines[] =
|
||||
"\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012";
|
||||
# define morkFile_kNewlinesCount 16
|
||||
# endif /* MORK_UNIX || MORK_BEOS */
|
||||
|
|
|
@ -653,7 +653,7 @@ morkNode::CutWeakRef(morkEnv* ev)
|
|||
return outRefs;
|
||||
}
|
||||
|
||||
static const char* morkNode_kBroken = "broken";
|
||||
static const char morkNode_kBroken[] = "broken";
|
||||
|
||||
/*public non-poly*/ const char*
|
||||
morkNode::GetNodeAccessAsString() const // e.g. "open", "shut", etc.
|
||||
|
|
|
@ -179,7 +179,7 @@ morkStream::CloseStream(morkEnv* ev) // called by CloseMorkNode();
|
|||
|
||||
#define morkStream_kSpacesPerIndent 1 /* one space per indent */
|
||||
#define morkStream_kMaxIndentDepth 70 /* max indent of 70 space bytes */
|
||||
static const char* morkStream_kSpaces // next line to ease length perception
|
||||
static const char morkStream_kSpaces[] // next line to ease length perception
|
||||
= " ";
|
||||
// 123456789_123456789_123456789_123456789_123456789_123456789_123456789_
|
||||
// morkStream_kSpaces above must contain (at least) 70 spaces (ASCII 0x20)
|
||||
|
|
|
@ -411,7 +411,7 @@ morkWriter::WriteMore(morkEnv* ev) // call until IsWritingDone() is true
|
|||
return ev->Good();
|
||||
}
|
||||
|
||||
static const char* morkWriter_kHexDigits = "0123456789ABCDEF";
|
||||
static const char morkWriter_kHexDigits[] = "0123456789ABCDEF";
|
||||
|
||||
mork_size
|
||||
morkWriter::WriteYarn(morkEnv* ev, const mdbYarn* inYarn)
|
||||
|
|
Загрузка…
Ссылка в новой задаче