annotate a few printf stragglers
- Found a few more va_list functions when reviewing last diff
Esse commit está contido em:
@@ -308,7 +308,7 @@ private:
|
||||
public: void print(const char *msg, bool indent = true);
|
||||
|
||||
private:
|
||||
void print(const char *fmt, va_list ap);
|
||||
void print(const char *fmt, va_list ap) ATTRIBUTE_PRINTF(2,0);
|
||||
void printSubstring(const char *start, int length);
|
||||
void printIndent();
|
||||
std::string getFormattedName(const std::string &file);
|
||||
|
||||
@@ -1062,11 +1062,13 @@ static int get_php_tiff_bytes_per_format(int format) {
|
||||
#define TAG_FMT_DOUBLE 12
|
||||
|
||||
static int php_vspprintf(char **pbuf, size_t max_len,
|
||||
const char *format, ...) {
|
||||
const char *fmt, ...) ATTRIBUTE_PRINTF(3,4);
|
||||
static int php_vspprintf(char **pbuf, size_t max_len,
|
||||
const char *fmt, ...) {
|
||||
va_list arglist;
|
||||
char *buf;
|
||||
va_start(arglist, format);
|
||||
int len = vspprintf_ap(&buf, max_len, format, arglist);
|
||||
va_start(arglist, fmt);
|
||||
int len = vspprintf_ap(&buf, max_len, fmt, arglist);
|
||||
if (buf) {
|
||||
#ifdef IM_MEMORY_CHECK
|
||||
*pbuf = php_strndup_impl(buf, len, __LINE__);
|
||||
@@ -1080,9 +1082,11 @@ static int php_vspprintf(char **pbuf, size_t max_len,
|
||||
}
|
||||
|
||||
static int php_vspprintf_ap(char **pbuf, size_t max_len,
|
||||
const char *format, va_list ap) {
|
||||
const char *fmt, va_list ap) ATTRIBUTE_PRINTF(3,0);
|
||||
static int php_vspprintf_ap(char **pbuf, size_t max_len,
|
||||
const char *fmt, va_list ap) {
|
||||
char *buf;
|
||||
int len = vspprintf_ap(&buf, max_len, format, ap);
|
||||
int len = vspprintf_ap(&buf, max_len, fmt, ap);
|
||||
if (buf) {
|
||||
#ifdef IM_MEMORY_CHECK
|
||||
*pbuf = php_strndup_impl(buf, len, __LINE__);
|
||||
|
||||
@@ -652,8 +652,7 @@ void Class::initInstanceBits() {
|
||||
i = 1;
|
||||
for (auto& pair : counts) {
|
||||
if (i >= 256) {
|
||||
Trace::traceRelease("skipping the remainder of the %" PRIu64
|
||||
" classes\n",
|
||||
Trace::traceRelease("skipping the remainder of the %zu classes\n",
|
||||
counts.size());
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -2307,8 +2307,8 @@ TranslatorX64::enterTC(TCA start, void* data) {
|
||||
start = TCA(0xbee5face);
|
||||
}
|
||||
|
||||
TRACE(2, "enterTC: request(%s) args: %" PRIx64 " %" PRIx64 " %"
|
||||
PRIx64 " %" PRIx64 " %" PRIx64 "\n",
|
||||
TRACE(2, "enterTC: request(%s) args: %" PRIxPTR " %" PRIxPTR " %"
|
||||
PRIxPTR " %" PRIxPTR " %" PRIxPTR "\n",
|
||||
reqName(info.requestNum),
|
||||
info.args[0], info.args[1], info.args[2], info.args[3],
|
||||
info.args[4]);
|
||||
@@ -3050,7 +3050,7 @@ TranslatorX64::checkTranslationLimit(SrcKey sk,
|
||||
INC_TPC(max_trans);
|
||||
if (debug && Trace::moduleEnabled(Trace::tx64, 2)) {
|
||||
const vector<TCA>& tns = srcRec.translations();
|
||||
TRACE(1, "Too many (%" PRId64 ") translations: %s, BC offset %d\n",
|
||||
TRACE(1, "Too many (%zd) translations: %s, BC offset %d\n",
|
||||
tns.size(), curUnit()->filepath()->data(),
|
||||
sk.offset());
|
||||
SKTRACE(2, sk, "{\n");
|
||||
@@ -3817,12 +3817,12 @@ std::string TranslatorX64::getUsage() {
|
||||
TargetCache::s_persistent_frontier - TargetCache::s_persistent_start;
|
||||
Util::string_printf(
|
||||
usage,
|
||||
"tx64: %9zd bytes (%" PRId64 "%%) in ahot.code\n"
|
||||
"tx64: %9zd bytes (%" PRId64 "%%) in a.code\n"
|
||||
"tx64: %9zd bytes (%" PRId64 "%%) in astubs.code\n"
|
||||
"tx64: %9zd bytes (%" PRId64 "%%) in m_globalData\n"
|
||||
"tx64: %9zd bytes (%" PRId64 "%%) in targetCache\n"
|
||||
"tx64: %9zd bytes (%" PRId64 "%%) in persistentCache\n",
|
||||
"tx64: %9zd bytes (%zd%%) in ahot.code\n"
|
||||
"tx64: %9zd bytes (%zd%%) in a.code\n"
|
||||
"tx64: %9zd bytes (%zd%%) in astubs.code\n"
|
||||
"tx64: %9zd bytes (%zd%%) in m_globalData\n"
|
||||
"tx64: %9zd bytes (%zd%%) in targetCache\n"
|
||||
"tx64: %9zd bytes (%zd%%) in persistentCache\n",
|
||||
aHotUsage, 100 * aHotUsage / ahot.code.size,
|
||||
aUsage, 100 * aUsage / a.code.size,
|
||||
stubsUsage, 100 * stubsUsage / astubs.code.size,
|
||||
|
||||
@@ -636,7 +636,7 @@ struct SpaceRecorder {
|
||||
if (Trace::moduleEnabledRelease(Trace::tcspace, 1)) {
|
||||
ptrdiff_t diff = m_a.code.frontier - m_start;
|
||||
if (diff) {
|
||||
Trace::traceRelease("TCSpace %10s %3" PRId64 "\n", m_name, diff);
|
||||
Trace::traceRelease("TCSpace %10s %3td\n", m_name, diff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -670,7 +670,7 @@ void Unit::defTypedef(Id id) {
|
||||
}
|
||||
|
||||
// There might also be a class with this name already.
|
||||
if (Class* cls = nameList->getCachedClass()) {
|
||||
if (nameList->getCachedClass()) {
|
||||
raise_error("The name %s is already defined as a class",
|
||||
thisType->name->data());
|
||||
return;
|
||||
|
||||
@@ -115,7 +115,7 @@ class DBQuery {
|
||||
* q.filterBy(q.Format("(%s > 0 or %s = 2)", field1, field2));
|
||||
*/
|
||||
const char *format(const char *fmt, ...) ATTRIBUTE_PRINTF(2,3);
|
||||
const char *format(const char *fmt, va_list ap);
|
||||
const char *format(const char *fmt, va_list ap) ATTRIBUTE_PRINTF(2,0);
|
||||
|
||||
/**
|
||||
* Use "`" to escape all field names in a comma delimited field list.
|
||||
|
||||
@@ -146,7 +146,8 @@ char *hdf_get_value (HDF *hdf, const char *name, const char *defval);
|
||||
* The data set maintains ownership of the string, if you want
|
||||
* a copy you either have to call strdup yourself.
|
||||
*/
|
||||
char* hdf_get_valuevf (HDF *hdf, const char *namefmt, va_list ap);
|
||||
char* hdf_get_valuevf (HDF *hdf, const char *namefmt, va_list ap)
|
||||
ATTRIBUTE_PRINTF(2,0);
|
||||
|
||||
/*
|
||||
* Function: hdf_get_valuef - Return the value of a node in the data set
|
||||
@@ -359,7 +360,8 @@ NEOERR* hdf_set_value (HDF *hdf, const char *name, const char *value);
|
||||
*/
|
||||
NEOERR* hdf_set_valuef (HDF *hdf, const char *fmt, ...)
|
||||
ATTRIBUTE_PRINTF(2,3);
|
||||
NEOERR* hdf_set_valuevf (HDF *hdf, const char *fmt, va_list ap);
|
||||
NEOERR* hdf_set_valuevf (HDF *hdf, const char *fmt, va_list ap)
|
||||
ATTRIBUTE_PRINTF(2,0);
|
||||
|
||||
/*
|
||||
* Function: hdf_set_int_value - Set the value of a named node to a number
|
||||
|
||||
@@ -111,7 +111,8 @@ typedef char BOOL;
|
||||
#define FALSE 0
|
||||
#endif
|
||||
|
||||
void ne_vwarn (const char *fmt, va_list ap);
|
||||
void ne_vwarn (const char *fmt, va_list ap)
|
||||
ATTRIBUTE_PRINTF(1,0);
|
||||
void ne_warn (const char *fmt, ...)
|
||||
ATTRIBUTE_PRINTF(1,2);
|
||||
void ne_set_log (int level);
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário