diff options
author | unknown <monty@mysql.com/nosik.monty.fi> | 2006-11-27 18:16:08 +0200 |
---|---|---|
committer | unknown <monty@mysql.com/nosik.monty.fi> | 2006-11-27 18:16:08 +0200 |
commit | 4555818f142b532875dcab073dac1168f284739b (patch) | |
tree | 20c7910ad3251fb39027f6528cd4c0524220a1a0 /storage/ndb | |
parent | 028eab234822ec7d51a20f8143057ab8f3f7bf9b (diff) | |
download | mariadb-git-4555818f142b532875dcab073dac1168f284739b.tar.gz |
Removed compiler warnings
Ensure that my_size_t is always unsigned (to get predictiable results from system to system)
Removed some %lld, as these are not portable
BUILD/FINISH.sh:
Remove configure files from storage engines (as some of them may be old versions and may cause conflicts)
client/mysqldump.c:
Removed compiler warning
client/mysqlslap.c:
Removed compiler warning
client/mysqltest.c:
Removed compiler warning
cmd-line-utils/readline/bind.c:
Removed compiler warning
cmd-line-utils/readline/histfile.c:
Removed compiler warning
include/my_global.h:
Ensure that my_size_t is always unsigned (to get predictiable results from system to system)
Moved my_offset_t here from parse_file.h
sql/event_data_objects.cc:
Removed compiler warning
sql/event_scheduler.cc:
Removed compiler warning
sql/field.h:
Removed compiler warning
sql/ha_ndbcluster_binlog.cc:
Removed compiler warning
sql/ha_partition.cc:
Removed compiler warning
sql/item_strfunc.cc:
Removed compiler warning
sql/log_event.cc:
Removed compiler warning
sql/mysqld.cc:
Removed compiler warning
sql/parse_file.h:
Moved my_offset_t to my_global.h
sql/rpl_utility.cc:
Removed compiler warning
sql/sql_binlog.cc:
Removed compiler warning
sql/sql_cache.cc:
Removed compiler warning
sql/tztime.cc:
Removed compiler warning
storage/archive/ha_archive.cc:
Removed compiler warning
Removed %lld as it's not portable
storage/heap/hp_write.c:
Removed compiler warning
storage/innobase/os/os0file.c:
Removed compiler warning
storage/myisam/myisampack.c:
Removed compiler warning
storage/myisammrg/myrg_rkey.c:
Removed compiler warning
storage/ndb/include/kernel/signaldata/DictTabInfo.hpp:
Use my_offsetof instead of offsetof to get rid of compiler warnings
storage/ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp:
Removed compiler warning
storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp:
Removed compiler warning
Note: Someone from NDB team should check this fix!
storage/ndb/src/kernel/vm/Rope.cpp:
Removed compiler warning
storage/ndb/src/mgmapi/mgmapi.cpp:
Removed compiler warning
storage/ndb/src/ndbapi/Ndb.cpp:
Removed compiler warning
storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp:
Removed compiler warning
storage/ndb/src/ndbapi/NdbScanOperation.cpp:
Removed compiler warning
storage/ndb/src/ndbapi/NdbTransaction.cpp:
Removed compiler warning
storage/ndb/src/ndbapi/Ndblist.cpp:
Removed compiler warning
Diffstat (limited to 'storage/ndb')
-rw-r--r-- | storage/ndb/include/kernel/signaldata/DictTabInfo.hpp | 20 | ||||
-rw-r--r-- | storage/ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp | 2 | ||||
-rw-r--r-- | storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp | 2 | ||||
-rw-r--r-- | storage/ndb/src/kernel/vm/Rope.cpp | 14 | ||||
-rw-r--r-- | storage/ndb/src/mgmapi/mgmapi.cpp | 6 | ||||
-rw-r--r-- | storage/ndb/src/ndbapi/Ndb.cpp | 29 | ||||
-rw-r--r-- | storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp | 6 | ||||
-rw-r--r-- | storage/ndb/src/ndbapi/NdbScanOperation.cpp | 6 | ||||
-rw-r--r-- | storage/ndb/src/ndbapi/NdbTransaction.cpp | 2 | ||||
-rw-r--r-- | storage/ndb/src/ndbapi/Ndblist.cpp | 2 |
10 files changed, 46 insertions, 43 deletions
diff --git a/storage/ndb/include/kernel/signaldata/DictTabInfo.hpp b/storage/ndb/include/kernel/signaldata/DictTabInfo.hpp index 86186929394..6e76840fc5f 100644 --- a/storage/ndb/include/kernel/signaldata/DictTabInfo.hpp +++ b/storage/ndb/include/kernel/signaldata/DictTabInfo.hpp @@ -47,17 +47,17 @@ inline int my_decimal_get_binary_size(uint precision, uint scale) #endif #define DTIMAP(x, y, z) \ - { DictTabInfo::y, offsetof(x, z), SimpleProperties::Uint32Value, 0, (~0), 0 } + { DictTabInfo::y, my_offsetof(x, z), SimpleProperties::Uint32Value, 0, (~0), 0 } #define DTIMAP2(x, y, z, u, v) \ - { DictTabInfo::y, offsetof(x, z), SimpleProperties::Uint32Value, u, v, 0 } + { DictTabInfo::y, my_offsetof(x, z), SimpleProperties::Uint32Value, u, v, 0 } #define DTIMAPS(x, y, z, u, v) \ - { DictTabInfo::y, offsetof(x, z), SimpleProperties::StringValue, u, v, 0 } + { DictTabInfo::y, my_offsetof(x, z), SimpleProperties::StringValue, u, v, 0 } #define DTIMAPB(x, y, z, u, v, l) \ - { DictTabInfo::y, offsetof(x, z), SimpleProperties::BinaryValue, u, v, \ - offsetof(x, l) } + { DictTabInfo::y, my_offsetof(x, z), SimpleProperties::BinaryValue, u, v, \ + my_offsetof(x, l) } #define DTIBREAK(x) \ { DictTabInfo::x, 0, SimpleProperties::InvalidValue, 0, 0, 0 } @@ -602,17 +602,17 @@ public: }; #define DFGIMAP(x, y, z) \ - { DictFilegroupInfo::y, offsetof(x, z), SimpleProperties::Uint32Value, 0, (~0), 0 } + { DictFilegroupInfo::y, my_offsetof(x, z), SimpleProperties::Uint32Value, 0, (~0), 0 } #define DFGIMAP2(x, y, z, u, v) \ - { DictFilegroupInfo::y, offsetof(x, z), SimpleProperties::Uint32Value, u, v, 0 } + { DictFilegroupInfo::y, my_offsetof(x, z), SimpleProperties::Uint32Value, u, v, 0 } #define DFGIMAPS(x, y, z, u, v) \ - { DictFilegroupInfo::y, offsetof(x, z), SimpleProperties::StringValue, u, v, 0 } + { DictFilegroupInfo::y, my_offsetof(x, z), SimpleProperties::StringValue, u, v, 0 } #define DFGIMAPB(x, y, z, u, v, l) \ - { DictFilegroupInfo::y, offsetof(x, z), SimpleProperties::BinaryValue, u, v, \ - offsetof(x, l) } + { DictFilegroupInfo::y, my_offsetof(x, z), SimpleProperties::BinaryValue, u, v, \ + my_offsetof(x, l) } #define DFGIBREAK(x) \ { DictFilegroupInfo::x, 0, SimpleProperties::InvalidValue, 0, 0, 0 } diff --git a/storage/ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp b/storage/ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp index d3a4e72c3f0..9c66636980a 100644 --- a/storage/ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp +++ b/storage/ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp @@ -68,7 +68,7 @@ print_head(const char * filename, const SchemaFile * sf) if (! checkonly) { ndbout << "----- Schemafile: " << filename << " -----" << endl; ndbout_c("Magic: %.*s ByteOrder: %.8x NdbVersion: %s FileSize: %d", - sizeof(sf->Magic), + (int) sizeof(sf->Magic), sf->Magic, sf->ByteOrder, version(sf->NdbVersion), diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp index 677eff53559..5d4115c1d2d 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp +++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp @@ -1066,6 +1066,7 @@ Dbtup::updateVarSizeNotNULL(Uint32* in_buffer, terrorCode= ZAI_INCONSISTENCY_ERROR; return false; } + return false; } bool @@ -1485,6 +1486,7 @@ Dbtup::updateDiskVarSizeNotNULL(Uint32* in_buffer, terrorCode= ZAI_INCONSISTENCY_ERROR; return false; } + return false; } bool diff --git a/storage/ndb/src/kernel/vm/Rope.cpp b/storage/ndb/src/kernel/vm/Rope.cpp index 0c90d8f65d5..b6bce864caf 100644 --- a/storage/ndb/src/kernel/vm/Rope.cpp +++ b/storage/ndb/src/kernel/vm/Rope.cpp @@ -30,8 +30,8 @@ ConstRope::copy(char* buf) const { int ConstRope::compare(const char * str, size_t len) const { if(DEBUG_ROPE) - ndbout_c("ConstRope[ %d 0x%x 0x%x ]::compare(%s, %d)", - head.used, head.firstItem, head.lastItem, str, len); + ndbout_c("ConstRope[ %d 0x%x 0x%x ]::compare(%s, %d)", + head.used, head.firstItem, head.lastItem, str, (int) len); Uint32 left = head.used > len ? len : head.used; Ptr<Segment> curr; curr.i = head.firstItem; @@ -60,7 +60,7 @@ ConstRope::compare(const char * str, size_t len) const { } } if(DEBUG_ROPE) - ndbout_c("ConstRope::compare(%s, %d) -> %d", str, len, head.used > len); + ndbout_c("ConstRope::compare(%s, %d) -> %d", str, (int) len, head.used > len); return head.used > len; } @@ -91,7 +91,7 @@ Rope::copy(char* buf) const { int Rope::compare(const char * str, size_t len) const { if(DEBUG_ROPE) - ndbout_c("Rope::compare(%s, %d)", str, len); + ndbout_c("Rope::compare(%s, %d)", str, (int) len); Uint32 left = head.used > len ? len : head.used; Ptr<Segment> curr; curr.i = head.firstItem; @@ -100,7 +100,7 @@ Rope::compare(const char * str, size_t len) const { int res = memcmp(str, (const char*)curr.p->data, 4 * getSegmentSize()); if(res != 0){ if(DEBUG_ROPE) - ndbout_c("Rope::compare(%s, %d, %s) -> %d", str, len, + ndbout_c("Rope::compare(%s, %d, %s) -> %d", str, (int) len, (const char*)curr.p->data, res); return res; } @@ -120,14 +120,14 @@ Rope::compare(const char * str, size_t len) const { } } if(DEBUG_ROPE) - ndbout_c("Rope::compare(%s, %d) -> %d", str, len, head.used > len); + ndbout_c("Rope::compare(%s, %d) -> %d", str, (int) len, head.used > len); return head.used > len; } bool Rope::assign(const char * s, size_t len, Uint32 hash){ if(DEBUG_ROPE) - ndbout_c("Rope::assign(%s, %d, 0x%x)", s, len, hash); + ndbout_c("Rope::assign(%s, %d, 0x%x)", s, (int) len, hash); m_hash = hash; head.used = (head.used + 3) / 4; release(); diff --git a/storage/ndb/src/mgmapi/mgmapi.cpp b/storage/ndb/src/mgmapi/mgmapi.cpp index 90a863402e8..b64b24aa3cf 100644 --- a/storage/ndb/src/mgmapi/mgmapi.cpp +++ b/storage/ndb/src/mgmapi/mgmapi.cpp @@ -184,7 +184,7 @@ ndb_mgm_create_handle() h->mgmd_version_minor= -1; h->mgmd_version_build= -1; - DBUG_PRINT("info", ("handle=0x%x", (UintPtr)h)); + DBUG_PRINT("info", ("handle: 0x%lx", (ulong) h)); DBUG_RETURN(h); } @@ -201,7 +201,7 @@ int ndb_mgm_set_connectstring(NdbMgmHandle handle, const char * mgmsrv) { DBUG_ENTER("ndb_mgm_set_connectstring"); - DBUG_PRINT("info", ("handle=0x%x", (UintPtr)handle)); + DBUG_PRINT("info", ("handle: 0x%lx", (ulong) handle)); handle->cfg.~LocalConfig(); new (&(handle->cfg)) LocalConfig; if (!handle->cfg.init(mgmsrv, 0) || @@ -243,7 +243,7 @@ ndb_mgm_destroy_handle(NdbMgmHandle * handle) DBUG_ENTER("ndb_mgm_destroy_handle"); if(!handle) DBUG_VOID_RETURN; - DBUG_PRINT("info", ("handle=0x%x", (UintPtr)(* handle))); + DBUG_PRINT("info", ("handle: 0x%lx", (ulong) (* handle))); /** * important! only disconnect if connected * other code relies on this diff --git a/storage/ndb/src/ndbapi/Ndb.cpp b/storage/ndb/src/ndbapi/Ndb.cpp index 843cb7668e6..ca5fd07d724 100644 --- a/storage/ndb/src/ndbapi/Ndb.cpp +++ b/storage/ndb/src/ndbapi/Ndb.cpp @@ -768,7 +768,7 @@ Ndb::getAutoIncrementValue(const char* aTableName, TupleIdRange & range = info->m_tuple_id_range; if (getTupleIdFromNdb(table, range, tupleId, cacheSize) == -1) DBUG_RETURN(-1); - DBUG_PRINT("info", ("value %llu", (ulonglong)tupleId)); + DBUG_PRINT("info", ("value %lu", (ulong) tupleId)); DBUG_RETURN(0); } @@ -791,7 +791,7 @@ Ndb::getAutoIncrementValue(const NdbDictionary::Table * aTable, TupleIdRange & range = info->m_tuple_id_range; if (getTupleIdFromNdb(table, range, tupleId, cacheSize) == -1) DBUG_RETURN(-1); - DBUG_PRINT("info", ("value %llu", (ulonglong)tupleId)); + DBUG_PRINT("info", ("value %lu", (ulong)tupleId)); DBUG_RETURN(0); } @@ -806,7 +806,7 @@ Ndb::getAutoIncrementValue(const NdbDictionary::Table * aTable, if (getTupleIdFromNdb(table, range, tupleId, cacheSize) == -1) DBUG_RETURN(-1); - DBUG_PRINT("info", ("value %llu", (ulonglong)tupleId)); + DBUG_PRINT("info", ("value %lu", (ulong)tupleId)); DBUG_RETURN(0); } @@ -819,7 +819,7 @@ Ndb::getTupleIdFromNdb(const NdbTableImpl* table, { assert(range.m_first_tuple_id < range.m_last_tuple_id); tupleId = ++range.m_first_tuple_id; - DBUG_PRINT("info", ("next cached value %llu", (ulonglong)tupleId)); + DBUG_PRINT("info", ("next cached value %lu", (ulong)tupleId)); } else { @@ -856,7 +856,7 @@ Ndb::readAutoIncrementValue(const char* aTableName, TupleIdRange & range = info->m_tuple_id_range; if (readTupleIdFromNdb(table, range, tupleId) == -1) DBUG_RETURN(-1); - DBUG_PRINT("info", ("value %llu", (ulonglong)tupleId)); + DBUG_PRINT("info", ("value %lu", (ulong)tupleId)); DBUG_RETURN(0); } @@ -879,7 +879,7 @@ Ndb::readAutoIncrementValue(const NdbDictionary::Table * aTable, TupleIdRange & range = info->m_tuple_id_range; if (readTupleIdFromNdb(table, range, tupleId) == -1) DBUG_RETURN(-1); - DBUG_PRINT("info", ("value %llu", (ulonglong)tupleId)); + DBUG_PRINT("info", ("value %lu", (ulong)tupleId)); DBUG_RETURN(0); } @@ -893,7 +893,7 @@ Ndb::readAutoIncrementValue(const NdbDictionary::Table * aTable, if (readTupleIdFromNdb(table, range, tupleId) == -1) DBUG_RETURN(-1); - DBUG_PRINT("info", ("value %llu", (ulonglong)tupleId)); + DBUG_PRINT("info", ("value %lu", (ulong)tupleId)); DBUG_RETURN(0); } @@ -994,8 +994,8 @@ Ndb::setTupleIdInNdb(const NdbTableImpl* table, { range.m_first_tuple_id = tupleId - 1; DBUG_PRINT("info", - ("Setting next auto increment cached value to %llu", - (ulonglong)tupleId)); + ("Setting next auto increment cached value to %lu", + (ulong)tupleId)); DBUG_RETURN(0); } } @@ -1049,7 +1049,8 @@ Ndb::opTupleIdOnNdb(const NdbTableImpl* table, { DBUG_ENTER("Ndb::opTupleIdOnNdb"); Uint32 aTableId = table->m_id; - DBUG_PRINT("enter", ("table=%u value=%llu op=%u", aTableId, opValue, op)); + DBUG_PRINT("enter", ("table: %u value: %lu op: %u", + aTableId, (ulong) opValue, op)); NdbTransaction* tConnection = NULL; NdbOperation* tOperation = NULL; @@ -1117,8 +1118,8 @@ Ndb::opTupleIdOnNdb(const NdbTableImpl* table, else { DBUG_PRINT("info", - ("Setting next auto increment value (db) to %llu", - (ulonglong)opValue)); + ("Setting next auto increment value (db) to %lu", + (ulong) opValue)); range.m_first_tuple_id = range.m_last_tuple_id = opValue - 1; } break; @@ -1244,9 +1245,9 @@ int Ndb::setDatabaseAndSchemaName(const NdbDictionary::Table* t) if (s2 && s2 != s1 + 1) { char buf[NAME_LEN + 1]; if (s1 - s0 <= NAME_LEN && s2 - (s1 + 1) <= NAME_LEN) { - sprintf(buf, "%.*s", s1 - s0, s0); + sprintf(buf, "%.*s", (int) (s1 - s0), s0); setDatabaseName(buf); - sprintf(buf, "%.*s", s2 - (s1 + 1), s1 + 1); + sprintf(buf, "%.*s", (int) (s2 - (s1 + 1)), s1 + 1); setDatabaseSchemaName(buf); return 0; } diff --git a/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp b/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp index 0b12b9d2f0f..1996dec024a 100644 --- a/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp +++ b/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp @@ -1508,9 +1508,9 @@ NdbEventBuffer::execSUB_GCP_COMPLETE_REP(const SubGcpCompleteRep * const rep) else { /** out of order something */ - ndbout_c("out of order bucket: %d gci: %lld m_latestGCI: %lld", - bucket-(Gci_container*)m_active_gci.getBase(), - gci, m_latestGCI); + ndbout_c("out of order bucket: %d gci: %ld m_latestGCI: %ld", + (int) (bucket-(Gci_container*)m_active_gci.getBase()), + (long) gci, (long) m_latestGCI); bucket->m_state = Gci_container::GC_COMPLETE; bucket->m_gcp_complete_rep_count = 1; // Prevent from being reused m_latest_complete_GCI = gci; diff --git a/storage/ndb/src/ndbapi/NdbScanOperation.cpp b/storage/ndb/src/ndbapi/NdbScanOperation.cpp index 64dc544b226..3e2081b6018 100644 --- a/storage/ndb/src/ndbapi/NdbScanOperation.cpp +++ b/storage/ndb/src/ndbapi/NdbScanOperation.cpp @@ -669,9 +669,9 @@ NdbScanOperation::doSend(int ProcessorId) void NdbScanOperation::close(bool forceSend, bool releaseOp) { DBUG_ENTER("NdbScanOperation::close"); - DBUG_PRINT("enter", ("this=%x tcon=%x con=%x force=%d release=%d", - (UintPtr)this, - (UintPtr)m_transConnection, (UintPtr)theNdbCon, + DBUG_PRINT("enter", ("this: 0x%lx tcon: 0x%lx con: 0x%lx force: %d release: %d", + (long) this, + (long) m_transConnection, (long) theNdbCon, forceSend, releaseOp)); if(m_transConnection){ diff --git a/storage/ndb/src/ndbapi/NdbTransaction.cpp b/storage/ndb/src/ndbapi/NdbTransaction.cpp index 4d7a6a59371..0c59746c1e9 100644 --- a/storage/ndb/src/ndbapi/NdbTransaction.cpp +++ b/storage/ndb/src/ndbapi/NdbTransaction.cpp @@ -1010,7 +1010,7 @@ void NdbTransaction::releaseExecutedScanOperation(NdbIndexScanOperation* cursorOp) { DBUG_ENTER("NdbTransaction::releaseExecutedScanOperation"); - DBUG_PRINT("enter", ("this=0x%x op=0x%x", (UintPtr)this, (UintPtr)cursorOp)); + DBUG_PRINT("enter", ("this: 0x%lx op: 0x%lx", (ulong) this, (ulong) cursorOp)); releaseScanOperation(&m_firstExecutedScanOp, 0, cursorOp); diff --git a/storage/ndb/src/ndbapi/Ndblist.cpp b/storage/ndb/src/ndbapi/Ndblist.cpp index f82348fc91d..a0d22466db4 100644 --- a/storage/ndb/src/ndbapi/Ndblist.cpp +++ b/storage/ndb/src/ndbapi/Ndblist.cpp @@ -361,7 +361,7 @@ void Ndb::releaseScanOperation(NdbIndexScanOperation* aScanOperation) { DBUG_ENTER("Ndb::releaseScanOperation"); - DBUG_PRINT("enter", ("op=%x", (UintPtr)aScanOperation)); + DBUG_PRINT("enter", ("op: 0x%lx", (ulong) aScanOperation)); #ifdef ndb_release_check_dup { NdbIndexScanOperation* tOp = theScanOpIdleList; while (tOp != NULL) { |