Add more vararg error-checking annotation

This was SVN commit r7073.
This commit is contained in:
Ykkrosh 2009-08-04 16:08:41 +00:00
parent d83945e1e7
commit 4a4269824b
8 changed files with 21 additions and 14 deletions

View File

@ -34,7 +34,7 @@
CUnit::CUnit(CObjectEntry* object, CEntity* entity, CObjectManager& objectManager,
const std::set<CStr>& actorSelections)
: m_Object(object), m_Model(object->m_Model->Clone()), m_Entity(entity),
m_ID(invalidUnitId), m_ActorSelections(actorSelections), m_PlayerID(invalidPlayerId),
m_ID(invalidUnitId), m_ActorSelections(actorSelections), m_PlayerID(invalidPlayerId),
m_ObjectManager(objectManager)
{
m_Animation = new CUnitAnimation(*this);

View File

@ -306,7 +306,7 @@ private:
*
* @param str Error message
*/
void ReportParseError(const char *str, ...);
void ReportParseError(const char *str, ...) PRINTF_ARGS(2);
/**
* You input the name of the object type, and let's
@ -334,7 +334,7 @@ private:
*/
//--------------------------------------------------------
/**
/*
Xeromyces_* functions tree
<objects> (ReadRootObjects)
|
@ -346,7 +346,7 @@ private:
|
+-Optional Type Extensions (IGUIObject::ReadExtendedElement) TODO
|
+-«object» *recursive*
+-<<object>> *recursive*
<styles> (ReadRootStyles)

View File

@ -211,4 +211,11 @@ private:\
// TODO: support _Printf_format_string_ for VC9+
#endif
// annotate vararg functions that expect to end with an explicit NULL
#if GCC_VERSION
# define SENTINEL_ARG __attribute__ ((sentinel))
#else
# define SENTINEL_ARG
#endif
#endif // #ifndef INCLUDED_CODE_ANNOTATION

View File

@ -107,7 +107,7 @@ extern bool ogl_HaveVersion(const char* version);
* @return 0 if all are present; otherwise, the first extension in the
* list that's not supported (useful for reporting errors).
**/
extern const char* ogl_HaveExtensions(int dummy, ...);
extern const char* ogl_HaveExtensions(int dummy, ...) SENTINEL_ARG;
/**
* get a list of all supported extensions.

View File

@ -671,7 +671,7 @@ static void detect_gl_upload_caps()
{
// note: we don't bother checking for GL_S3_s3tc - it is incompatible
// and irrelevant (was never widespread).
have_s3tc = ogl_HaveExtensions(0, "GL_ARB_texture_compression", "GL_EXT_texture_compression_s3tc", 0) == 0;
have_s3tc = ogl_HaveExtensions(0, "GL_ARB_texture_compression", "GL_EXT_texture_compression_s3tc", NULL) == 0;
}
// allow app hook to make ogl_tex_override calls

View File

@ -435,11 +435,11 @@ public:
void Error ( const CStr& message );
void Fatal ( const CStr& message );
void DebugFormat ( const char* pFormat, ... );
void WarnFormat ( const char* pFormat, ... );
void InfoFormat ( const char* pFormat, ... );
void ErrorFormat ( const char* pFormat, ... );
void FatalFormat ( const char* pFormat, ... );
void DebugFormat ( const char* pFormat, ... ) PRINTF_ARGS(2);
void WarnFormat ( const char* pFormat, ... ) PRINTF_ARGS(2);
void InfoFormat ( const char* pFormat, ... ) PRINTF_ARGS(2);
void ErrorFormat ( const char* pFormat, ... ) PRINTF_ARGS(2);
void FatalFormat ( const char* pFormat, ... ) PRINTF_ARGS(2);
/**
* Retrieves the name of the logger

View File

@ -1093,7 +1093,7 @@ void Init(const CmdLineArgs& args, int flags)
"GL_EXT_draw_range_elements",
"GL_ARB_texture_env_combine",
"GL_ARB_texture_env_dot3",
0);
NULL);
if(missing)
{
wchar_t buf[500];

View File

@ -443,13 +443,13 @@ void CRenderer::EnumCaps()
if (ogl_HaveExtension("GL_SGIS_generate_mipmap")) {
m_Caps.m_GenerateMipmaps=true;
}
if (0 == ogl_HaveExtensions(0, "GL_ARB_shader_objects", "GL_ARB_shading_language_100", 0))
if (0 == ogl_HaveExtensions(0, "GL_ARB_shader_objects", "GL_ARB_shading_language_100", NULL))
{
if (ogl_HaveExtension("GL_ARB_vertex_shader"))
m_Caps.m_VertexShader=true;
}
if (0 == ogl_HaveExtensions(0, "GL_ARB_shadow", "GL_ARB_depth_texture", 0)) {
if (0 == ogl_HaveExtensions(0, "GL_ARB_shadow", "GL_ARB_depth_texture", NULL)) {
// According to Delphi3d.net, all relevant graphics chips that support depth textures
// (i.e. Geforce3+, Radeon9500+, even i915) also have >= 4 TMUs, so this restriction
// isn't actually a restriction, and it helps with integrating depth texture