pike.git/
src/
constants.c
Branch:
Tag:
Non-build tags
All tags
No tags
2011-11-05
2011-11-05 15:47:44 by Martin Nilsson <nilsson@opera.com>
5d1e952a94a1e70084847756b489d8a48534ffbc (
35
lines) (+
16
/-
19
)
[
Show
|
Annotate
]
Branch:
7.9
Fix a warning about returning uninitialized pointer by not returning the pointer at all.
134:
flags, optimize, docode); }
-
PMOD_EXPORT
struct
callable *
add_efun2(const char *name,
+
PMOD_EXPORT
void
add_efun2(const char *name,
c_fun fun, const char *type, int flags,
143:
{ struct svalue s; struct pike_string *n;
-
struct callable *ret;
+
n=make_shared_string(name); SET_SVAL(s, T_FUNCTION, FUNCTION_BUILTIN, efun,
151:
low_add_efun(n, &s); free_svalue(&s); free_string(n);
-
return ret;
+
}
-
PMOD_EXPORT
struct
callable *
add_efun(const char *name, c_fun fun, const char *type, int flags)
+
PMOD_EXPORT
void
add_efun(const char *name, c_fun fun, const char *type, int flags)
{
-
return
add_efun2(name,fun,type,flags,0,0);
+
add_efun2(name,fun,type,flags,0,0);
}
-
PMOD_EXPORT
struct
callable *
quick_add_efun(const char *name, ptrdiff_t name_length,
+
PMOD_EXPORT
void
quick_add_efun(const char *name, ptrdiff_t name_length,
c_fun fun, const char *type, ptrdiff_t type_length, int flags,
169:
struct svalue s; struct pike_string *n; struct pike_type *t;
-
struct callable *ret;
+
#ifdef PIKE_DEBUG if(simple_mapping_string_lookup(builtin_constants, name))
183:
#endif add_ref(n); SET_SVAL(s, T_FUNCTION, FUNCTION_BUILTIN, efun,
-
ret =
low_make_callable(fun, n, t, flags, optimize, docode));
+
low_make_callable(fun, n, t, flags, optimize, docode));
mapping_string_insert(builtin_constants, n, &s); free_svalue(&s); free_string(n);
-
return ret;
+
} PMOD_EXPORT void visit_callable (struct callable *c, int action)