mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-09-29 21:05:40 +00:00
Fix some GCC warnings
This was SVN commit r7067.
This commit is contained in:
@@ -277,7 +277,7 @@ JSBool JSI_Camera::construct( JSContext* cx, JSObject* UNUSED(obj),
|
||||
|
||||
JSObject* camera = JS_NewObject( cx, &JSI_Camera::JSI_class, NULL, NULL );
|
||||
|
||||
JSU_REQUIRE_PARAM_RANGE(0, 3);
|
||||
JSU_REQUIRE_MAX_PARAMS(3);
|
||||
Camera_Info* camera_info = 0;
|
||||
switch(argc)
|
||||
{
|
||||
|
||||
@@ -47,7 +47,7 @@ TraceEntry::TraceEntry(const char* text)
|
||||
char pathname[PATH_MAX] = "";
|
||||
char action;
|
||||
#if EMULATE_SECURE_CRT
|
||||
#define TRACE_FORMAT "%f: %c \"%" STRINGIZE(PATH_MAX) "[^\"]\" %d\n" /* use a macro to allow compile-time type-checking */
|
||||
#define TRACE_FORMAT "%f: %c \"%" STRINGIZE(PATH_MAX) "[^\"]\" %zd\n" /* use a macro to allow compile-time type-checking */
|
||||
const int fieldsRead = sscanf(text, TRACE_FORMAT, &m_timestamp, &action, pathname, &m_size);
|
||||
#else
|
||||
#define TRACE_FORMAT "%f: %c \"%[^\"]\" %d\n"
|
||||
|
||||
@@ -35,6 +35,10 @@ extern jsval jsu_report_param_error(JSContext* cx, jsval* rval);
|
||||
#define JSU_REQUIRE_PARAM_RANGE(min_number, max_number)\
|
||||
if(!(min_number <= argc && argc <= max_number))\
|
||||
return jsu_report_param_error(cx, rval);
|
||||
// .. require at most a certain count
|
||||
#define JSU_REQUIRE_MAX_PARAMS(max_number)\
|
||||
if(argc > max_number)\
|
||||
return jsu_report_param_error(cx, rval);
|
||||
// .. require at least a certain count (rarely needed)
|
||||
#define JSU_REQUIRE_MIN_PARAMS(min_number)\
|
||||
if(argc < min_number)\
|
||||
|
||||
@@ -1058,7 +1058,7 @@ JSBool SetCameraTarget( JSContext* cx, JSObject* UNUSED(obj), uintN argc, jsval*
|
||||
// that revision so that they match user-submitted crashdumps).
|
||||
JSBool GetBuildTimestamp( JSContext* cx, JSObject*, uintN argc, jsval* argv, jsval* rval )
|
||||
{
|
||||
JSU_REQUIRE_PARAM_RANGE(0, 1);
|
||||
JSU_REQUIRE_MAX_PARAMS(1);
|
||||
|
||||
char buf[200];
|
||||
|
||||
@@ -1387,7 +1387,7 @@ JSBool GetTrigger( JSContext* cx, JSObject* UNUSED(globalObject), uintN argc, js
|
||||
// Reveal map
|
||||
JSBool RevealMap( JSContext* cx, JSObject* UNUSED(globalObject), uintN argc, jsval* argv, jsval* rval )
|
||||
{
|
||||
JSU_REQUIRE_PARAM_RANGE(0, 1);
|
||||
JSU_REQUIRE_MAX_PARAMS(1);
|
||||
|
||||
int newValue;
|
||||
if(argc == 0)
|
||||
|
||||
Reference in New Issue
Block a user