From: Michael Wallner Date: Mon, 13 Jun 2005 15:25:06 +0000 (+0000) Subject: - add PHP_ATTRIBUTE_FORMAT X-Git-Tag: RELEASE_0_9_0~29 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=d07df3421e591d06d0bc000fabf49d6987a8bcd5;p=m6w6%2Fext-http - add PHP_ATTRIBUTE_FORMAT --- diff --git a/php_http_api.h b/php_http_api.h index 1924f96..bd229e3 100644 --- a/php_http_api.h +++ b/php_http_api.h @@ -33,7 +33,7 @@ extern STATUS _http_parse_key_list(const char *list, HashTable *items, char sepa #define http_error(type, code, string) _http_error_ex(type, code, "%s", string) #define http_error_ex _http_error_ex -extern void _http_error_ex(long type, long code, const char *format, ...); +extern void _http_error_ex(long type, long code, const char *format, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4); #define http_exit(s, h) http_exit_ex((s), (h), 1) #define http_exit_ex(s, h, f) _http_exit_ex((s), (h), (f) TSRMLS_CC) diff --git a/phpstr/phpstr.h b/phpstr/phpstr.h index 2dc6fe1..9ef71ef 100644 --- a/phpstr/phpstr.h +++ b/phpstr/phpstr.h @@ -82,19 +82,19 @@ PHPSTR_API void phpstr_resize_ex(phpstr *buf, size_t len, size_t override_size); #define phpstr_appends(b, a) phpstr_append((b), (a), sizeof(a)-1) #define phpstr_appendl(b, a) phpstr_append((b), (a), strlen(a)) PHPSTR_API size_t phpstr_append(phpstr *buf, const char *append, size_t append_len); -PHPSTR_API size_t phpstr_appendf(phpstr *buf, const char *format, ...); +PHPSTR_API size_t phpstr_appendf(phpstr *buf, const char *format, ...) PHP_ATTRIBUTE_FORMAT(printf, 2, 3); /* insert data at a specific position of the phpstr */ #define phpstr_inserts(b, i, o) phpstr_insert((b), (i), sizeof(i)-1, (o)) #define phpstr_insertl(b, i, o) phpstr_insert((b), (i), strlen(i), (o)) PHPSTR_API size_t phpstr_insert(phpstr *buf, const char *insert, size_t insert_len, size_t offset); -PHPSTR_API size_t phpstr_insertf(phpstr *buf, size_t offset, const char *format, ...); +PHPSTR_API size_t phpstr_insertf(phpstr *buf, size_t offset, const char *format, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4); /* prepend data */ #define phpstr_prepends(b, p) phpstr_prepend((b), (p), sizeof(p)-1) #define phpstr_prependl(b, p) phpstr_prepend((b), (p), strlen(p)) PHPSTR_API size_t phpstr_prepend(phpstr *buf, const char *prepend, size_t prepend_len); -PHPSTR_API size_t phpstr_prependf(phpstr *buf, const char *format, ...); +PHPSTR_API size_t phpstr_prependf(phpstr *buf, const char *format, ...) PHP_ATTRIBUTE_FORMAT(printf, 2, 3); /* get a zero-terminated string */ PHPSTR_API char *phpstr_data(const phpstr *buf, char **into, size_t *len);