From 4c2732a1dad1de295c9219ee3afac007b2d7ba05 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 28 Jan 2009 14:36:08 -0800 Subject: Use 'static' as much as possible This change just inserts 'static' on runtime, tapset, and generated C functions and globals, so the compiler can do a better job of optimizing. My tests with small scripts show ~10% reduction in compile time and ~20% reduction in module size. Larger scripts may show less benefit, but I expect purely positive results. --- runtime/string.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'runtime/string.c') diff --git a/runtime/string.c b/runtime/string.c index 13c46dda..c087c783 100644 --- a/runtime/string.c +++ b/runtime/string.c @@ -28,7 +28,7 @@ * variable number of args. */ -int _stp_snprintf(char *buf, size_t size, const char *fmt, ...) +static int _stp_snprintf(char *buf, size_t size, const char *fmt, ...) { va_list args; int i; @@ -39,7 +39,7 @@ int _stp_snprintf(char *buf, size_t size, const char *fmt, ...) return i; } -int _stp_vscnprintf(char *buf, size_t size, const char *fmt, va_list args) +static int _stp_vscnprintf(char *buf, size_t size, const char *fmt, va_list args) { unsigned i = _stp_vsnprintf(buf,size,fmt,args); return (i >= size) ? (size - 1) : i; @@ -60,7 +60,7 @@ int _stp_vscnprintf(char *buf, size_t size, const char *fmt, va_list args) * in will have "..." after the second quote. * @param user Set this to indicate the input string pointer is a userspace pointer. */ -void _stp_text_str(char *outstr, char *in, int len, int quoted, int user) +static void _stp_text_str(char *outstr, char *in, int len, int quoted, int user) { const int length = len; char c, *out = outstr; -- cgit