Loading ndb/examples/select_all/select_all.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -98,7 +98,7 @@ void ResultSetContainer::init(NdbDictionary::Dictionary * dict, // Store all attribute names for the table for (int i = 0; i < m_cols; i++) { m_names[i] = new char[255]; snprintf(m_names[i], 255, "%s", tab->getColumn(i)->getName()); BaseString::snprintf(m_names[i], 255, "%s", tab->getColumn(i)->getName()); } } Loading ndb/include/kernel/signaldata/ArbitSignalData.hpp +6 −6 Original line number Diff line number Diff line Loading @@ -54,7 +54,7 @@ public: } inline void getText(char *buf, size_t buf_len) const { snprintf(buf, buf_len, "%08x%08x", data[0], data[1]); BaseString::snprintf(buf, buf_len, "%08x%08x", data[0], data[1]); } /* inline char* getText() const { Loading Loading @@ -113,19 +113,19 @@ public: static inline void getErrText(Uint32 code, char* buf, size_t buf_len) { switch (code) { case ErrTicket: snprintf(buf, buf_len, "invalid arbitrator-ticket"); BaseString::snprintf(buf, buf_len, "invalid arbitrator-ticket"); break; case ErrToomany: snprintf(buf, buf_len, "too many requests"); BaseString::snprintf(buf, buf_len, "too many requests"); break; case ErrState: snprintf(buf, buf_len, "invalid state"); BaseString::snprintf(buf, buf_len, "invalid state"); break; case ErrTimeout: snprintf(buf, buf_len, "timeout"); BaseString::snprintf(buf, buf_len, "timeout"); break; default: snprintf(buf, buf_len, "unknown error [code=%u]", code); BaseString::snprintf(buf, buf_len, "unknown error [code=%u]", code); break; } } Loading ndb/include/kernel/signaldata/SignalData.hpp +1 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ #include <ndb_global.h> #include <ndb_limits.h> #include <kernel_types.h> #include <BaseString.hpp> #define ASSERT_BOOL(flag, message) assert(flag<=1) #define ASSERT_RANGE(value, min, max, message) \ Loading ndb/include/util/basestring_vsnprintf.h 0 → 100644 +29 −0 Original line number Diff line number Diff line /* Copyright (C) 2003 MySQL AB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef BASESTRING_VSNPRINTF_H #define BASESTRING_VSNPRINTF_H #include <stdarg.h> #if defined(__cplusplus) extern "C" { #endif int basestring_snprintf(char*, size_t, const char*, ...); int basestring_vsnprintf(char*,size_t, const char*,va_list); #if defined(__cplusplus) } #endif #endif ndb/src/common/debugger/DebuggerNames.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <ndb_global.h> #include <BaseString.hpp> #include "DebuggerNames.hpp" Loading Loading @@ -131,7 +132,7 @@ getBlockName(unsigned short blockNo, const char * ret){ return localBlockNames[blockNo-MIN_BLOCK_NO]; if (ret == 0) { static char buf[20]; snprintf(buf, sizeof(buf), "BLOCK#%d", (int)blockNo); BaseString::snprintf(buf, sizeof(buf), "BLOCK#%d", (int)blockNo); return buf; } return ret; Loading Loading
ndb/examples/select_all/select_all.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -98,7 +98,7 @@ void ResultSetContainer::init(NdbDictionary::Dictionary * dict, // Store all attribute names for the table for (int i = 0; i < m_cols; i++) { m_names[i] = new char[255]; snprintf(m_names[i], 255, "%s", tab->getColumn(i)->getName()); BaseString::snprintf(m_names[i], 255, "%s", tab->getColumn(i)->getName()); } } Loading
ndb/include/kernel/signaldata/ArbitSignalData.hpp +6 −6 Original line number Diff line number Diff line Loading @@ -54,7 +54,7 @@ public: } inline void getText(char *buf, size_t buf_len) const { snprintf(buf, buf_len, "%08x%08x", data[0], data[1]); BaseString::snprintf(buf, buf_len, "%08x%08x", data[0], data[1]); } /* inline char* getText() const { Loading Loading @@ -113,19 +113,19 @@ public: static inline void getErrText(Uint32 code, char* buf, size_t buf_len) { switch (code) { case ErrTicket: snprintf(buf, buf_len, "invalid arbitrator-ticket"); BaseString::snprintf(buf, buf_len, "invalid arbitrator-ticket"); break; case ErrToomany: snprintf(buf, buf_len, "too many requests"); BaseString::snprintf(buf, buf_len, "too many requests"); break; case ErrState: snprintf(buf, buf_len, "invalid state"); BaseString::snprintf(buf, buf_len, "invalid state"); break; case ErrTimeout: snprintf(buf, buf_len, "timeout"); BaseString::snprintf(buf, buf_len, "timeout"); break; default: snprintf(buf, buf_len, "unknown error [code=%u]", code); BaseString::snprintf(buf, buf_len, "unknown error [code=%u]", code); break; } } Loading
ndb/include/kernel/signaldata/SignalData.hpp +1 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ #include <ndb_global.h> #include <ndb_limits.h> #include <kernel_types.h> #include <BaseString.hpp> #define ASSERT_BOOL(flag, message) assert(flag<=1) #define ASSERT_RANGE(value, min, max, message) \ Loading
ndb/include/util/basestring_vsnprintf.h 0 → 100644 +29 −0 Original line number Diff line number Diff line /* Copyright (C) 2003 MySQL AB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef BASESTRING_VSNPRINTF_H #define BASESTRING_VSNPRINTF_H #include <stdarg.h> #if defined(__cplusplus) extern "C" { #endif int basestring_snprintf(char*, size_t, const char*, ...); int basestring_vsnprintf(char*,size_t, const char*,va_list); #if defined(__cplusplus) } #endif #endif
ndb/src/common/debugger/DebuggerNames.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <ndb_global.h> #include <BaseString.hpp> #include "DebuggerNames.hpp" Loading Loading @@ -131,7 +132,7 @@ getBlockName(unsigned short blockNo, const char * ret){ return localBlockNames[blockNo-MIN_BLOCK_NO]; if (ret == 0) { static char buf[20]; snprintf(buf, sizeof(buf), "BLOCK#%d", (int)blockNo); BaseString::snprintf(buf, sizeof(buf), "BLOCK#%d", (int)blockNo); return buf; } return ret; Loading