summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2010-02-18 23:50:58 -0800
committerKristian Høgsberg <krh@bitplanet.net>2010-02-19 09:18:13 -0500
commit60b0cae412029e53654f38d0de151908f1feb310 (patch)
tree77f8d023f40f49603586070ab80c599e95efc906 /src
parent9d9afe9393fde99858ddf40e478bc16cf44e60dc (diff)
Remove _mesa_atoi in favor of plain atoi.
Diffstat (limited to 'src')
-rw-r--r--src/gallium/state_trackers/glx/xlib/glx_api.c4
-rw-r--r--src/mesa/drivers/x11/fakeglx.c4
-rw-r--r--src/mesa/main/imports.c9
-rw-r--r--src/mesa/main/imports.h3
-rw-r--r--src/mesa/shader/nvfragparse.c6
-rw-r--r--src/mesa/shader/nvvertparse.c10
-rw-r--r--src/mesa/shader/shader_api.c2
7 files changed, 14 insertions, 24 deletions
diff --git a/src/gallium/state_trackers/glx/xlib/glx_api.c b/src/gallium/state_trackers/glx/xlib/glx_api.c
index 971b6e71cb..e3b52f521b 100644
--- a/src/gallium/state_trackers/glx/xlib/glx_api.c
+++ b/src/gallium/state_trackers/glx/xlib/glx_api.c
@@ -280,7 +280,7 @@ default_depth_bits(void)
int zBits;
const char *zEnv = _mesa_getenv("MESA_GLX_DEPTH_BITS");
if (zEnv)
- zBits = _mesa_atoi(zEnv);
+ zBits = atoi(zEnv);
else
zBits = DEFAULT_SOFTWARE_DEPTH_BITS;
return zBits;
@@ -292,7 +292,7 @@ default_alpha_bits(void)
int aBits;
const char *aEnv = _mesa_getenv("MESA_GLX_ALPHA_BITS");
if (aEnv)
- aBits = _mesa_atoi(aEnv);
+ aBits = atoi(aEnv);
else
aBits = 0;
return aBits;
diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c
index fd6d71317b..075b9a1e5f 100644
--- a/src/mesa/drivers/x11/fakeglx.c
+++ b/src/mesa/drivers/x11/fakeglx.c
@@ -378,7 +378,7 @@ default_depth_bits(void)
int zBits;
const char *zEnv = _mesa_getenv("MESA_GLX_DEPTH_BITS");
if (zEnv)
- zBits = _mesa_atoi(zEnv);
+ zBits = atoi(zEnv);
else
zBits = DEFAULT_SOFTWARE_DEPTH_BITS;
return zBits;
@@ -390,7 +390,7 @@ default_alpha_bits(void)
int aBits;
const char *aEnv = _mesa_getenv("MESA_GLX_ALPHA_BITS");
if (aEnv)
- aBits = _mesa_atoi(aEnv);
+ aBits = atoi(aEnv);
else
aBits = 0;
return aBits;
diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c
index 4c5e99fbbe..2a0952c7af 100644
--- a/src/mesa/main/imports.c
+++ b/src/mesa/main/imports.c
@@ -860,13 +860,6 @@ _mesa_strdup( const char *s )
}
}
-/** Wrapper around atoi() */
-int
-_mesa_atoi(const char *s)
-{
- return atoi(s);
-}
-
/** Wrapper around strtod() */
double
_mesa_strtod( const char *s, char **end )
@@ -982,7 +975,7 @@ output_if_debug(const char *prefixString, const char *outputString,
* set *to any value*.
*/
#ifdef DEBUG
- debug = (env != NULL && _mesa_atoi(env) == 0) ? 0 : 1;
+ debug = (env != NULL && atoi(env) == 0) ? 0 : 1;
#else
debug = (env != NULL) ? 1 : 0;
#endif
diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h
index 3c8f734e36..124642178c 100644
--- a/src/mesa/main/imports.h
+++ b/src/mesa/main/imports.h
@@ -614,9 +614,6 @@ _mesa_getenv( const char *var );
extern char *
_mesa_strdup( const char *s );
-extern int
-_mesa_atoi( const char *s );
-
extern double
_mesa_strtod( const char *s, char **end );
diff --git a/src/mesa/shader/nvfragparse.c b/src/mesa/shader/nvfragparse.c
index 79b2e5989c..ff3a921777 100644
--- a/src/mesa/shader/nvfragparse.c
+++ b/src/mesa/shader/nvfragparse.c
@@ -580,7 +580,7 @@ Parse_TextureImageId(struct parse_state *parseState,
imageSrc[2] != 'X') {
RETURN_ERROR1("Expected TEX# source");
}
- unit = _mesa_atoi((const char *) imageSrc + 3);
+ unit = atoi((const char *) imageSrc + 3);
if ((unit < 0 || unit > MAX_TEXTURE_IMAGE_UNITS) ||
(unit == 0 && (imageSrc[3] != '0' || imageSrc[4] != 0))) {
RETURN_ERROR1("Invalied TEX# source index");
@@ -717,7 +717,7 @@ Parse_TempReg(struct parse_state *parseState, GLint *tempRegNum)
RETURN_ERROR1("Expected R## or H##");
if (IsDigit(token[1])) {
- GLint reg = _mesa_atoi((const char *) (token + 1));
+ GLint reg = atoi((const char *) (token + 1));
if (token[0] == 'H')
reg += 32;
if (reg >= MAX_NV_FRAGMENT_PROGRAM_TEMPS)
@@ -768,7 +768,7 @@ Parse_ProgramParamReg(struct parse_state *parseState, GLint *regNum)
if (IsDigit(token[0])) {
/* a numbered program parameter register */
- GLint reg = _mesa_atoi((const char *) token);
+ GLint reg = atoi((const char *) token);
if (reg >= MAX_NV_FRAGMENT_PROGRAM_PARAMS)
RETURN_ERROR1("Invalid constant program number");
*regNum = reg;
diff --git a/src/mesa/shader/nvvertparse.c b/src/mesa/shader/nvvertparse.c
index cd5b57ff74..630de7c2d7 100644
--- a/src/mesa/shader/nvvertparse.c
+++ b/src/mesa/shader/nvvertparse.c
@@ -309,7 +309,7 @@ Parse_TempReg(struct parse_state *parseState, GLint *tempRegNum)
RETURN_ERROR1("Expected R##");
if (IsDigit(token[1])) {
- GLint reg = _mesa_atoi((char *) (token + 1));
+ GLint reg = atoi((char *) (token + 1));
if (reg >= MAX_NV_VERTEX_PROGRAM_TEMPS)
RETURN_ERROR1("Bad temporary register name");
*tempRegNum = reg;
@@ -363,7 +363,7 @@ Parse_AbsParamReg(struct parse_state *parseState, GLint *regNum)
if (IsDigit(token[0])) {
/* a numbered program parameter register */
- GLint reg = _mesa_atoi((char *) token);
+ GLint reg = atoi((char *) token);
if (reg >= MAX_NV_VERTEX_PROGRAM_PARAMS)
RETURN_ERROR1("Bad program parameter number");
*regNum = reg;
@@ -397,7 +397,7 @@ Parse_ParamReg(struct parse_state *parseState, struct prog_src_register *srcReg)
/* a numbered program parameter register */
GLint reg;
(void) Parse_Token(parseState, token);
- reg = _mesa_atoi((char *) token);
+ reg = atoi((char *) token);
if (reg >= MAX_NV_VERTEX_PROGRAM_PARAMS)
RETURN_ERROR1("Bad program parameter number");
srcReg->File = PROGRAM_ENV_PARAM;
@@ -423,7 +423,7 @@ Parse_ParamReg(struct parse_state *parseState, struct prog_src_register *srcReg)
RETURN_ERROR;
if (IsDigit(token[0])) {
- const GLint k = _mesa_atoi((char *) token);
+ const GLint k = atoi((char *) token);
if (sign == '-') {
if (k > 64)
RETURN_ERROR1("Bad address offset");
@@ -480,7 +480,7 @@ Parse_AttribReg(struct parse_state *parseState, GLint *tempRegNum)
RETURN_ERROR1("Only v[0] accessible in vertex state programs");
if (IsDigit(token[0])) {
- GLint reg = _mesa_atoi((char *) token);
+ GLint reg = atoi((char *) token);
if (reg >= MAX_NV_VERTEX_PROGRAM_INPUTS)
RETURN_ERROR1("Bad vertex attribute register name");
*tempRegNum = reg;
diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c
index c3b49ed4d4..44310d2e61 100644
--- a/src/mesa/shader/shader_api.c
+++ b/src/mesa/shader/shader_api.c
@@ -1385,7 +1385,7 @@ _mesa_get_uniform_location(GLcontext *ctx, GLuint program, const GLchar *name)
location = _mesa_lookup_uniform(shProg->Uniforms, newName);
if (location >= 0) {
- const GLint element = _mesa_atoi(c + 1);
+ const GLint element = atoi(c + 1);
if (element > 0) {
/* get type of the uniform array element */
struct gl_program_parameter *p;