summaryrefslogtreecommitdiff
path: root/storage/ndb
diff options
context:
space:
mode:
authorMichael Widenius <monty@mysql.com>2009-01-31 23:22:44 +0200
committerMichael Widenius <monty@mysql.com>2009-01-31 23:22:44 +0200
commitbd4e65515f556b6bca45d06d81370d99cf649647 (patch)
treed52f87d228fdffdc4be98775856597a857a9d9dd /storage/ndb
parent37db97b0e25de1a1dc0d16bc9b88b0c3a2e9f9a2 (diff)
downloadmariadb-git-bd4e65515f556b6bca45d06d81370d99cf649647.tar.gz
Fixed compiler warnings found by gcc 4.3.2
- Added braces around expressions with &&, ||, & and | - Added empty line before ; for empty while and for loops - Added () around if with assignments - Removed const before function returning simple type Changed BUILD scripts to not build with NDB BUILD/SETUP.sh: By default, don't build ndb with --max in Maria tree. NDB is not kept up to date anyway in 5.1 client/mysql.cc: Added braces around && to get rid of compiler warnings sql/event_db_repository.cc: Added braces around && to get rid of compiler warnings sql/events.cc: Added braces around && to get rid of compiler warnings sql/field.cc: Added braces around && to get rid of compiler warnings Fixed for loops sql/field.h: Added braces around & to get rid of compiler warnings sql/field_conv.cc: Added braces around && to get rid of compiler warnings Fixed bug when copying between DATETIME fields and strict dates are used Removed not needeed else sql/gstream.cc: Added braces around && to get rid of compiler warnings sql/ha_ndbcluster.cc: Added braces around && to get rid of compiler warnings Added {} to get rid of compiler warnings sql/handler.cc: Added braces around && to get rid of compiler warnings sql/item.cc: Added braces around && to get rid of compiler warnings sql/item_cmpfunc.cc: Added braces around && to get rid of compiler warnings Removed some not needed space sql/item_func.cc: Added braces around && to get rid of compiler warnings sql/item_strfunc.cc: Added braces around && to get rid of compiler warnings sql/item_subselect.cc: Added braces around && to get rid of compiler warnings sql/item_sum.cc: Added braces around && to get rid of compiler warnings sql/item_timefunc.cc: Added braces around && to get rid of compiler warnings sql/item_xmlfunc.cc: Added empty line before ; for empty while and for loops sql/log.cc: Added braces around && to get rid of compiler warnings sql/log_event.cc: Added braces around && to get rid of compiler warnings Removed not needed else sql/log_event_old.cc: Added braces around && to get rid of compiler warnings sql/opt_range.cc: Added braces around && to get rid of compiler warnings sql/opt_sum.cc: Added braces around && to get rid of compiler warnings sql/set_var.cc: Added empty line before ; for empty while and for loops Added () around if with assignments sql/slave.cc: Added braces around && to get rid of compiler warnings Added empty line before ; for empty while and for loops sql/spatial.h: Added braces around && to get rid of compiler warnings sql/sql_acl.cc: Added braces around && to get rid of compiler warnings sql/sql_analyse.cc: Added empty line before ; for empty while and for loops sql/sql_base.cc: Added braces around && to get rid of compiler warnings sql/sql_connect.cc: Added braces around && to get rid of compiler warnings sql/sql_db.cc: Added braces around && to get rid of compiler warnings sql/sql_delete.cc: Added braces around && to get rid of compiler warnings sql/sql_help.cc: Added empty line before ; for empty while and for loops sql/sql_insert.cc: Added braces around && to get rid of compiler warnings Added () around if with assignments sql/sql_lex.cc: Cast char array references to uchar; Fixed wrong array referencing when using characters > ASCII 128 in SQL statments Added empty line before ; for empty while and for loops Trivial indent fixes Added braces around && to get rid of compiler warnings sql/sql_load.cc: Added braces around && to get rid of compiler warnings sql/sql_parse.cc: Added braces around && to get rid of compiler warnings sql/sql_partition.cc: Added braces around && to get rid of compiler warnings sql/sql_plugin.cc: Fixed bug in detecing if option variable should be readonly Added empty line before ; for empty while and for loops sql/sql_prepare.cc: Added braces around && to get rid of compiler warnings sql/sql_select.cc: Added braces around && to get rid of compiler warnings Added () around if with assignments Added empty line before ; for empty while and for loops sql/sql_show.cc: Added braces around && to get rid of compiler warnings sql/sql_table.cc: Added braces around && to get rid of compiler warnings sql/sql_trigger.cc: Added braces around && to get rid of compiler warnings sql/sql_update.cc: Added braces around && to get rid of compiler warnings sql/sql_yacc.yy: Added braces around && to get rid of compiler warnings sql/table.cc: Added braces around && to get rid of compiler warnings sql/table.h: Added braces around && to get rid of compiler warnings sql/time.cc: Added braces around && to get rid of compiler warnings sql/tztime.cc: Added braces around && to get rid of compiler warnings sql/uniques.cc: Added braces around && to get rid of compiler warnings storage/federated/ha_federated.cc: Fixed bug in testing of variable to ha_info() (Not critical) storage/heap/ha_heap.cc: Added braces around && to get rid of compiler warnings storage/maria/ha_maria.cc: Fixed bug: Mark that maria_log_dir_path is readonly Added braces around && to get rid of compiler warnings storage/ndb/include/ndbapi/NdbEventOperation.hpp: Removed const before function returning simple type storage/ndb/include/ndbapi/NdbOperation.hpp: Removed const before function returning simple type storage/ndb/src/ndbapi/Ndb.cpp: Added empty line before ; for empty while and for loops storage/ndb/src/ndbapi/NdbEventOperation.cpp: Removed const before function returning simple type storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp: Removed const before function returning simple type storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp: Removed const before function returning simple type storage/ndb/src/ndbapi/NdbRecAttr.cpp: Added empty line before ; for empty while and for loops storage/ndb/src/ndbapi/TransporterFacade.hpp: Added braces around && to get rid of compiler warnings
Diffstat (limited to 'storage/ndb')
-rw-r--r--storage/ndb/include/ndbapi/NdbEventOperation.hpp8
-rw-r--r--storage/ndb/include/ndbapi/NdbOperation.hpp4
-rw-r--r--storage/ndb/src/ndbapi/Ndb.cpp10
-rw-r--r--storage/ndb/src/ndbapi/NdbEventOperation.cpp8
-rw-r--r--storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp8
-rw-r--r--storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp8
-rw-r--r--storage/ndb/src/ndbapi/NdbRecAttr.cpp3
-rw-r--r--storage/ndb/src/ndbapi/TransporterFacade.hpp4
8 files changed, 29 insertions, 24 deletions
diff --git a/storage/ndb/include/ndbapi/NdbEventOperation.hpp b/storage/ndb/include/ndbapi/NdbEventOperation.hpp
index 437088d2893..0f98a4debef 100644
--- a/storage/ndb/include/ndbapi/NdbEventOperation.hpp
+++ b/storage/ndb/include/ndbapi/NdbEventOperation.hpp
@@ -178,22 +178,22 @@ public:
/**
* Check if table name has changed, for event TE_ALTER
*/
- const bool tableNameChanged() const;
+ bool tableNameChanged() const;
/**
* Check if table frm has changed, for event TE_ALTER
*/
- const bool tableFrmChanged() const;
+ bool tableFrmChanged() const;
/**
* Check if table fragmentation has changed, for event TE_ALTER
*/
- const bool tableFragmentationChanged() const;
+ bool tableFragmentationChanged() const;
/**
* Check if table range partition list name has changed, for event TE_ALTER
*/
- const bool tableRangeListChanged() const;
+ bool tableRangeListChanged() const;
/**
* Retrieve the GCI of the latest retrieved event
diff --git a/storage/ndb/include/ndbapi/NdbOperation.hpp b/storage/ndb/include/ndbapi/NdbOperation.hpp
index 78dbadfd7ab..713c29f028d 100644
--- a/storage/ndb/include/ndbapi/NdbOperation.hpp
+++ b/storage/ndb/include/ndbapi/NdbOperation.hpp
@@ -779,7 +779,7 @@ public:
/**
* Get the type of access for this operation
*/
- const Type getType() const;
+ Type getType() const;
/** @} *********************************************************************/
@@ -1135,7 +1135,7 @@ Return Value Return the Type.
Remark: Gets type of access.
******************************************************************************/
inline
-const NdbOperation::Type
+NdbOperation::Type
NdbOperation::getType() const
{
return m_type;
diff --git a/storage/ndb/src/ndbapi/Ndb.cpp b/storage/ndb/src/ndbapi/Ndb.cpp
index e6a1c2cfcfd..70e0dc7e2f2 100644
--- a/storage/ndb/src/ndbapi/Ndb.cpp
+++ b/storage/ndb/src/ndbapi/Ndb.cpp
@@ -1569,9 +1569,11 @@ Ndb::externalizeTableName(const char * internalTableName, bool fullyQualifiedNam
register const char *ptr = internalTableName;
// Skip database name
- while (*ptr && *ptr++ != table_name_separator);
+ while (*ptr && *ptr++ != table_name_separator)
+ ;
// Skip schema name
- while (*ptr && *ptr++ != table_name_separator);
+ while (*ptr && *ptr++ != table_name_separator)
+ ;
return ptr;
}
else
@@ -1591,7 +1593,9 @@ Ndb::externalizeIndexName(const char * internalIndexName, bool fullyQualifiedNam
register const char *ptr = internalIndexName;
// Scan name from the end
- while (*ptr++); ptr--; // strend
+ while (*ptr++)
+ ;
+ ptr--; // strend
while (ptr >= internalIndexName && *ptr != table_name_separator)
ptr--;
diff --git a/storage/ndb/src/ndbapi/NdbEventOperation.cpp b/storage/ndb/src/ndbapi/NdbEventOperation.cpp
index 5c6ed562dcc..1353ca40e95 100644
--- a/storage/ndb/src/ndbapi/NdbEventOperation.cpp
+++ b/storage/ndb/src/ndbapi/NdbEventOperation.cpp
@@ -96,22 +96,22 @@ NdbEventOperation::hasError() const
return m_impl.m_has_error;
}
-const bool NdbEventOperation::tableNameChanged() const
+bool NdbEventOperation::tableNameChanged() const
{
return m_impl.tableNameChanged();
}
-const bool NdbEventOperation::tableFrmChanged() const
+bool NdbEventOperation::tableFrmChanged() const
{
return m_impl.tableFrmChanged();
}
-const bool NdbEventOperation::tableFragmentationChanged() const
+bool NdbEventOperation::tableFragmentationChanged() const
{
return m_impl.tableFragmentationChanged();
}
-const bool NdbEventOperation::tableRangeListChanged() const
+bool NdbEventOperation::tableRangeListChanged() const
{
return m_impl.tableRangeListChanged();
}
diff --git a/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp b/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp
index dff953923fe..ed60650e33e 100644
--- a/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp
+++ b/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp
@@ -658,22 +658,22 @@ NdbEventOperationImpl::stop()
DBUG_RETURN(r);
}
-const bool NdbEventOperationImpl::tableNameChanged() const
+bool NdbEventOperationImpl::tableNameChanged() const
{
return (bool)AlterTableReq::getNameFlag(m_change_mask);
}
-const bool NdbEventOperationImpl::tableFrmChanged() const
+bool NdbEventOperationImpl::tableFrmChanged() const
{
return (bool)AlterTableReq::getFrmFlag(m_change_mask);
}
-const bool NdbEventOperationImpl::tableFragmentationChanged() const
+bool NdbEventOperationImpl::tableFragmentationChanged() const
{
return (bool)AlterTableReq::getFragDataFlag(m_change_mask);
}
-const bool NdbEventOperationImpl::tableRangeListChanged() const
+bool NdbEventOperationImpl::tableRangeListChanged() const
{
return (bool)AlterTableReq::getRangeListFlag(m_change_mask);
}
diff --git a/storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp b/storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp
index 3d71146588d..c027226584c 100644
--- a/storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp
+++ b/storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp
@@ -361,10 +361,10 @@ public:
NdbBlob *getBlobHandle(const NdbColumnImpl *, int n);
int readBlobParts(char* buf, NdbBlob* blob, Uint32 part, Uint32 count);
int receive_event();
- const bool tableNameChanged() const;
- const bool tableFrmChanged() const;
- const bool tableFragmentationChanged() const;
- const bool tableRangeListChanged() const;
+ bool tableNameChanged() const;
+ bool tableFrmChanged() const;
+ bool tableFragmentationChanged() const;
+ bool tableRangeListChanged() const;
Uint64 getGCI();
Uint32 getAnyValue() const;
Uint64 getLatestGCI();
diff --git a/storage/ndb/src/ndbapi/NdbRecAttr.cpp b/storage/ndb/src/ndbapi/NdbRecAttr.cpp
index 38ca14085f0..3b0329dd7ac 100644
--- a/storage/ndb/src/ndbapi/NdbRecAttr.cpp
+++ b/storage/ndb/src/ndbapi/NdbRecAttr.cpp
@@ -248,7 +248,8 @@ ndbrecattr_print_formatted(NdbOut& out, const NdbRecAttr &r,
{
const Uint32 *buf = (Uint32 *)r.aRef();
int k = (length+31)/32;
- while (k > 0 && (buf[--k] == 0));
+ while (k > 0 && (buf[--k] == 0))
+ ;
out.print("%X", buf[k]);
while (k > 0)
out.print("%.8X", buf[--k]);
diff --git a/storage/ndb/src/ndbapi/TransporterFacade.hpp b/storage/ndb/src/ndbapi/TransporterFacade.hpp
index 23fea8792f7..9a4347b333c 100644
--- a/storage/ndb/src/ndbapi/TransporterFacade.hpp
+++ b/storage/ndb/src/ndbapi/TransporterFacade.hpp
@@ -365,8 +365,8 @@ inline
bool
TransporterFacade::get_node_stopping(NodeId n) const {
const ClusterMgr::Node & node = theClusterMgr->getNodeInfo(n);
- return (!node.m_state.getSingleUserMode() &&
- (node.m_state.startLevel == NodeState::SL_STOPPING_1) ||
+ return ((!node.m_state.getSingleUserMode() &&
+ (node.m_state.startLevel == NodeState::SL_STOPPING_1)) ||
(node.m_state.startLevel == NodeState::SL_STOPPING_2));
}