mirror of https://github.com/OpenTTD/OpenTTD
(svn r18041) -Codechange: some coding style
parent
8f9157b648
commit
ac25ba62d2
|
@ -119,36 +119,36 @@ enum GRFExtendedLanguages {
|
||||||
* but according to a different lang.
|
* but according to a different lang.
|
||||||
*/
|
*/
|
||||||
struct GRFText {
|
struct GRFText {
|
||||||
public:
|
public:
|
||||||
static GRFText* New(byte langid, const char* text)
|
static GRFText *New(byte langid, const char *text)
|
||||||
{
|
{
|
||||||
return new(strlen(text) + 1) GRFText(langid, text);
|
return new (strlen(text) + 1) GRFText(langid, text);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
GRFText(byte langid_, const char* text_) : next(NULL), langid(langid_)
|
GRFText(byte langid_, const char *text_) : next(NULL), langid(langid_)
|
||||||
{
|
{
|
||||||
strcpy(text, text_);
|
strcpy(text, text_);
|
||||||
}
|
}
|
||||||
|
|
||||||
void *operator new(size_t size, size_t extra)
|
void *operator new(size_t size, size_t extra)
|
||||||
{
|
{
|
||||||
return ::operator new(size + extra);
|
return ::operator new(size + extra);
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/* dummy operator delete to silence VC8:
|
/* dummy operator delete to silence VC8:
|
||||||
* 'void *GRFText::operator new(size_t,size_t)' : no matching operator delete found;
|
* 'void *GRFText::operator new(size_t,size_t)' : no matching operator delete found;
|
||||||
* memory will not be freed if initialization throws an exception */
|
* memory will not be freed if initialization throws an exception */
|
||||||
void operator delete(void *p, size_t extra)
|
void operator delete(void *p, size_t extra)
|
||||||
{
|
{
|
||||||
return ::operator delete(p);
|
return ::operator delete(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GRFText *next;
|
GRFText *next;
|
||||||
byte langid;
|
byte langid;
|
||||||
char text[];
|
char text[];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue