Commit 76b09dd5 authored by unknown's avatar unknown

fix c++ style comments in .h and .c files

compilation problems on some platforms'

parent 25f1344f
......@@ -20,13 +20,13 @@
#include <kernel_types.h>
#include <RefConvert.hpp>
// 240
/* 240 */
#define MIN_API_BLOCK_NO 0x8000
// 2047
/* 2047 */
#define API_PACKED 0x07ff
// 4002
/* 4002 */
#define API_CLUSTERMGR 0x0FA2
#define BACKUP 0xF4
......
This diff is collapsed.
......@@ -50,7 +50,7 @@
**/
#define MAX_TUPLES_PER_PAGE 8191
#define MAX_TUPLES_BITS 13 /* 13 bits = 8191 tuples per page */
//#define MAX_NO_OF_TUPLEKEY 16 Not currently used
/*#define MAX_NO_OF_TUPLEKEY 16 Not currently used */
#define MAX_TABLES 1600
#define MAX_TAB_NAME_SIZE 128
#define MAX_ATTR_NAME_SIZE 32
......@@ -108,13 +108,13 @@
/*
* Ordered index constants. Make configurable per index later.
*/
#define MAX_TTREE_NODE_SIZE 64 // total words in node
#define MAX_TTREE_PREF_SIZE 4 // words in min prefix
#define MAX_TTREE_NODE_SLACK 2 // diff between max and min occupancy
#define MAX_TTREE_NODE_SIZE 64 /* total words in node */
#define MAX_TTREE_PREF_SIZE 4 /* words in min prefix */
#define MAX_TTREE_NODE_SLACK 2 /* diff between max and min occupancy */
/*
* Blobs.
*/
#define NDB_BLOB_HEAD_SIZE 2 // sizeof(NdbBlob::Head) >> 2
#define NDB_BLOB_HEAD_SIZE 2 /* sizeof(NdbBlob::Head) >> 2 */
#endif
......@@ -47,11 +47,11 @@ struct TriggerType {
struct TriggerActionTime {
enum Value {
TA_BEFORE = 0, // Immediate, before operation
TA_AFTER = 1, // Immediate, after operation
TA_DEFERRED = 2, // Before commit
TA_DETACHED = 3, // After commit in a separate transaction, NYI
TA_CUSTOM = 4 // Hardcoded per TriggerType
TA_BEFORE = 0, /* Immediate, before operation */
TA_AFTER = 1, /* Immediate, after operation */
TA_DEFERRED = 2, /* Before commit */
TA_DETACHED = 3, /* After commit in a separate transaction, NYI */
TA_CUSTOM = 4 /* Hardcoded per TriggerType */
};
};
......@@ -60,7 +60,7 @@ struct TriggerEvent {
TE_INSERT = 0,
TE_DELETE = 1,
TE_UPDATE = 2,
TE_CUSTOM = 3 // Hardcoded per TriggerType
TE_CUSTOM = 3 /* Hardcoded per TriggerType */
};
};
......
......@@ -64,32 +64,32 @@ extern "C" {
* NDB Cluster node types
*/
enum ndb_mgm_node_type {
NDB_MGM_NODE_TYPE_UNKNOWN = -1, /*/< Node type not known*/
NDB_MGM_NODE_TYPE_API = NODE_TYPE_API, /*/< An application node (API)*/
NDB_MGM_NODE_TYPE_NDB = NODE_TYPE_DB, /*/< A database node (DB)*/
NDB_MGM_NODE_TYPE_MGM = NODE_TYPE_MGM, /*/< A management server node (MGM)*/
NDB_MGM_NODE_TYPE_REP = NODE_TYPE_REP, ///< A replication node
NDB_MGM_NODE_TYPE_MIN = 0, /*/< Min valid value*/
NDB_MGM_NODE_TYPE_MAX = 3 /*/< Max valid value*/
NDB_MGM_NODE_TYPE_UNKNOWN = -1, /*< Node type not known*/
NDB_MGM_NODE_TYPE_API = NODE_TYPE_API,/*< An application node (API)*/
NDB_MGM_NODE_TYPE_NDB = NODE_TYPE_DB, /*< A database node (DB)*/
NDB_MGM_NODE_TYPE_MGM = NODE_TYPE_MGM,/*< A mgmt server node (MGM)*/
NDB_MGM_NODE_TYPE_REP = NODE_TYPE_REP,/*< A replication node */
NDB_MGM_NODE_TYPE_MIN = 0, /*< Min valid value*/
NDB_MGM_NODE_TYPE_MAX = 3 /*< Max valid value*/
};
/**
* Database node status
*/
enum ndb_mgm_node_status {
NDB_MGM_NODE_STATUS_UNKNOWN = 0, ///< Node status not known
NDB_MGM_NODE_STATUS_NO_CONTACT = 1, ///< No contact with node
NDB_MGM_NODE_STATUS_NOT_STARTED = 2, ///< Has not run starting protocol
NDB_MGM_NODE_STATUS_STARTING = 3, ///< Is running starting protocol
NDB_MGM_NODE_STATUS_STARTED = 4, ///< Running
NDB_MGM_NODE_STATUS_SHUTTING_DOWN = 5, ///< Is shutting down
NDB_MGM_NODE_STATUS_RESTARTING = 6, ///< Is restarting
NDB_MGM_NODE_STATUS_SINGLEUSER = 7, ///< Maintenance mode
NDB_MGM_NODE_STATUS_RESUME = 8, ///< Resume mode
NDB_MGM_NODE_STATUS_MIN = 0, ///< Min valid value
NDB_MGM_NODE_STATUS_MAX = 6 ///< Max valid value
NDB_MGM_NODE_STATUS_UNKNOWN = 0, /*< Node status not known*/
NDB_MGM_NODE_STATUS_NO_CONTACT = 1, /*< No contact with node*/
NDB_MGM_NODE_STATUS_NOT_STARTED = 2, /*< Has not run starting protocol*/
NDB_MGM_NODE_STATUS_STARTING = 3, /*< Is running starting protocol*/
NDB_MGM_NODE_STATUS_STARTED = 4, /*< Running*/
NDB_MGM_NODE_STATUS_SHUTTING_DOWN = 5, /*< Is shutting down*/
NDB_MGM_NODE_STATUS_RESTARTING = 6, /*< Is restarting*/
NDB_MGM_NODE_STATUS_SINGLEUSER = 7, /*< Maintenance mode*/
NDB_MGM_NODE_STATUS_RESUME = 8, /*< Resume mode*/
NDB_MGM_NODE_STATUS_MIN = 0, /*< Min valid value*/
NDB_MGM_NODE_STATUS_MAX = 6 /*< Max valid value*/
};
/**
......@@ -175,24 +175,27 @@ extern "C" {
* Structure returned by ndb_mgm_get_status
*/
struct ndb_mgm_node_state {
int node_id; ///< NDB Cluster node id
enum ndb_mgm_node_type node_type; ///< Type of NDB Cluster node
enum ndb_mgm_node_status node_status; ///< State of node
int start_phase; ///< Start phase.
///< @note Start phase is only
///< valid if
///< node_type is
///< NDB_MGM_NODE_TYPE_NDB and
///< node_status is
///< NDB_MGM_NODE_STATUS_STARTING
int dynamic_id; ///< Id for heartbeats and
///< master take-over
///< (only valid for DB nodes)
int node_group; ///< Node group of node
///< (only valid for DB nodes)
int version; ///< Internal version number
int connect_count; ///< No of times node has connected
///< or disconnected to the mgm srv
int node_id; /*< NDB Cluster node id*/
enum ndb_mgm_node_type node_type; /*< Type of NDB Cluster node*/
enum ndb_mgm_node_status node_status; /*< State of node*/
int start_phase; /*< Start phase.
*< @note Start phase is only
*< valid if
*< node_type is
*< NDB_MGM_NODE_TYPE_NDB and
*< node_status is
*< NDB_MGM_NODE_STATUS_STARTING
*/
int dynamic_id; /*< Id for heartbeats and
*< master take-over
*< (only valid for DB nodes)
*/
int node_group; /*< Node group of node
*< (only valid for DB nodes)*/
int version; /*< Internal version number*/
int connect_count; /*< No of times node has connected
*< or disconnected to the mgm srv
*/
char connect_address[sizeof("000.000.000.000")+1];
};
......@@ -200,9 +203,10 @@ extern "C" {
* Cluster status
*/
struct ndb_mgm_cluster_state {
int no_of_nodes; ///< No of entries in the
///< node_states array
struct ndb_mgm_node_state ///< An array with node_states
int no_of_nodes; /*< No of entries in the
*< node_states array
*/
struct ndb_mgm_node_state /*< An array with node_states*/
node_states[1];
const char *hostname;
};
......@@ -211,17 +215,18 @@ extern "C" {
* Default reply from the server
*/
struct ndb_mgm_reply {
int return_code; ///< 0 if successful,
///< otherwise error code.
char message[256]; ///< Error or reply message.
int return_code; /*< 0 if successful,
*< otherwise error code.
*/
char message[256]; /*< Error or reply message.*/
};
/**
* Default information types
*/
enum ndb_mgm_info {
NDB_MGM_INFO_CLUSTER, ///< ?
NDB_MGM_INFO_CLUSTERLOG ///< Cluster log
NDB_MGM_INFO_CLUSTER, /*< ?*/
NDB_MGM_INFO_CLUSTERLOG /*< Cluster log*/
};
/**
......@@ -229,39 +234,44 @@ extern "C" {
* (Used only in the development of NDB Cluster.)
*/
enum ndb_mgm_signal_log_mode {
NDB_MGM_SIGNAL_LOG_MODE_IN, ///< Log receiving signals
NDB_MGM_SIGNAL_LOG_MODE_OUT, ///< Log sending signals
NDB_MGM_SIGNAL_LOG_MODE_INOUT, ///< Log both sending/receiving
NDB_MGM_SIGNAL_LOG_MODE_OFF ///< Log off
NDB_MGM_SIGNAL_LOG_MODE_IN, /*< Log receiving signals */
NDB_MGM_SIGNAL_LOG_MODE_OUT, /*< Log sending signals*/
NDB_MGM_SIGNAL_LOG_MODE_INOUT, /*< Log both sending/receiving*/
NDB_MGM_SIGNAL_LOG_MODE_OFF /*< Log off*/
};
/**
* Log severities (used to filter the cluster log)
*/
enum ndb_mgm_clusterlog_level {
NDB_MGM_CLUSTERLOG_OFF = 0, ///< Cluster log off
NDB_MGM_CLUSTERLOG_DEBUG = 1, ///< Used in NDB Cluster
///< developement
NDB_MGM_CLUSTERLOG_INFO = 2, ///< Informational messages
NDB_MGM_CLUSTERLOG_WARNING = 3, ///< Conditions that are not
///< error condition, but
///< might require handling
NDB_MGM_CLUSTERLOG_ERROR = 4, ///< Conditions that should be
///< corrected
NDB_MGM_CLUSTERLOG_CRITICAL = 5, ///< Critical conditions, like
///< device errors or out of
///< resources
NDB_MGM_CLUSTERLOG_ALERT = 6, ///< A condition that should be
///< corrected immediately,
///< such as a corrupted system
NDB_MGM_CLUSTERLOG_ALL = 7 ///< All severities on
NDB_MGM_CLUSTERLOG_OFF = 0, /*< Cluster log off*/
NDB_MGM_CLUSTERLOG_DEBUG = 1, /*< Used in NDB Cluster
*< developement
*/
NDB_MGM_CLUSTERLOG_INFO = 2, /*< Informational messages*/
NDB_MGM_CLUSTERLOG_WARNING = 3, /*< Conditions that are not
*< error condition, but
*< might require handling
*/
NDB_MGM_CLUSTERLOG_ERROR = 4, /*< Conditions that should be
*< corrected
*/
NDB_MGM_CLUSTERLOG_CRITICAL = 5, /*< Critical conditions, like
*< device errors or out of
*< resources
*/
NDB_MGM_CLUSTERLOG_ALERT = 6, /*< A condition that should be
*< corrected immediately,
*< such as a corrupted system
*/
NDB_MGM_CLUSTERLOG_ALL = 7 /*< All severities on*/
};
/**
* Log categories
*/
enum ndb_mgm_event_category {
NDB_MGM_ILLEGAL_EVENT_CATEGORY = -1, ///< Invalid
NDB_MGM_ILLEGAL_EVENT_CATEGORY = -1, /*< Invalid
/**
* Events during all kinds of startups
*/
......
......@@ -26,21 +26,21 @@ extern "C" {
struct NdbCondition;
/*
// Create a condition
//
// * returnvalue: pointer to the condition structure
*/
/**
* Create a condition
*
* returnvalue: pointer to the condition structure
*/
struct NdbCondition* NdbCondition_Create(void);
/*
// Wait for a condition, allows a thread to wait for
// a condition and atomically releases the associated mutex.
//
// * p_cond: pointer to the condition structure
// * p_mutex: pointer to the mutex structure
// * returnvalue: 0 = succeeded, 1 = failed
*/
/**
* Wait for a condition, allows a thread to wait for
* a condition and atomically releases the associated mutex.
*
* p_cond: pointer to the condition structure
* p_mutex: pointer to the mutex structure
* returnvalue: 0 = succeeded, 1 = failed
*/
int NdbCondition_Wait(struct NdbCondition* p_cond,
NdbMutex* p_mutex);
......@@ -60,29 +60,29 @@ NdbCondition_WaitTimeout(struct NdbCondition* p_cond,
int msec);
/*
// Signal a condition
//
// * p_cond: pointer to the condition structure
// * returnvalue: 0 = succeeded, 1 = failed
*/
/**
* Signal a condition
*
* p_cond: pointer to the condition structure
* returnvalue: 0 = succeeded, 1 = failed
*/
int NdbCondition_Signal(struct NdbCondition* p_cond);
/*
// Broadcast a condition
//
// * p_cond: pointer to the condition structure
// * returnvalue: 0 = succeeded, 1 = failed
*/
/**
* Broadcast a condition
*
* p_cond: pointer to the condition structure
* returnvalue: 0 = succeeded, 1 = failed
*/
int NdbCondition_Broadcast(struct NdbCondition* p_cond);
/*
// Destroy a condition
//
// * p_cond: pointer to the condition structure
// * returnvalue: 0 = succeeded, 1 = failed
*/
/**
* Destroy a condition
*
* p_cond: pointer to the condition structure
* returnvalue: 0 = succeeded, 1 = failed
*/
int NdbCondition_Destroy(struct NdbCondition* p_cond);
#ifdef __cplusplus
......
......@@ -28,35 +28,35 @@
struct tms
{
time_t tms_utime; // user time
time_t tms_stime; // system time
time_t tms_cutime; // user time of children
time_t tms_cstime; // system time of children
time_t tms_utime; /* user time */
time_t tms_stime; /* system time */
time_t tms_cutime; /* user time of children */
time_t tms_cstime; /* system time of children */
};
struct timespec
{
long tv_sec; // Seconds
long tv_nsec; // Nanoseconds
long tv_sec; /* Seconds */
long tv_nsec; /* Nanoseconds */
};
#define strcasecmp(a,b) _strcmpi(a,b)
// Exports a WIN32 getopt function
/* Exports a WIN32 getopt function */
extern int optind;
extern char *optarg;
int getopt(int, char **, char *opts);
#endif // NDB_WIN32
#endif /* NDB_WIN32 */
#ifdef NDB_ALPHA
#ifdef NDB_GCC // only for NDB_ALPHA
#ifdef NDB_GCC /* only for NDB_ALPHA */
extern int gnuShouldNotUseRPCC();
#define RPCC() gnuShouldNotUseRPCC();
#else
#ifdef NDB_WIN32
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
#endif /* __cplusplus */
u_int64 __asm(char *, ...);
double __dasm(char *, ...);
float __fasm(char *, ...);
......@@ -65,32 +65,32 @@ extern "C" {
int __ADD_ATOMIC_LONG2(void *, int);
#ifdef __cplusplus
};
#endif //__cplusplus
#endif /* __cplusplus */
#pragma intrinsic (__asm, __dasm, __fasm)
#pragma intrinsic(_ReleaseSpinLock, _AcquireSpinLock)
#pragma intrinsic(__ADD_ATOMIC_LONG2)
#endif // NDB_WIN32
#endif /* NDB_WIN32 */
#define RPCC() ((int)__asm(" rpcc v0;"))
#define MB() __asm(" mb;");
#define WMB() __asm(" wmb;");
#ifdef USE_INITIALSP
#define IS_IP() (__asm(" mov sp,v0;") < IPinitialSP)
#else // USE_INITIALSP
#else /* USE_INITIALSP */
#define IS_IP() (((__asm(" rpcc v0;") >> 32) & 0x7) == IP_CPU)
#endif
#endif //NDB_GCC
#else // NDB_ALPHA
#endif /* NDB_GCC */
#else /* NDB_ALPHA */
#if defined NDB_SPARC
#define MB() asm ("membar 0x0;"); // LoadLoad
#define WMB() asm ("membar 0x3;"); // StoreStore
#else // NDB_SPARC
#define MB() asm ("membar 0x0;"); /* LoadLoad */
#define WMB() asm ("membar 0x3;"); /* StoreStore */
#else /* NDB_SPARC */
#define MB()
#define WMB()
#endif // NDB_SPARC
#endif /* NDB_SPARC */
#define IS_IP() (1==1)
extern int shouldNotUseRPCC();
#define RPCC() shouldNotUseRPCC();
#endif // NDB_ALPHA
#endif /* NDB_ALPHA */
#endif
......@@ -42,7 +42,7 @@ inline void prefetch(void* p)
{
#ifdef NDB_ALPHA
__asm(" ldl r31,0(a0);", p);
#endif // NDB_ALPHA
#endif /* NDB_ALPHA */
#ifdef NDB_FORTE6
sparc_prefetch_read_once(p);
#else
......@@ -54,7 +54,7 @@ inline void writehint(void* p)
{
#ifdef NDB_ALPHA
__asm(" wh64 (a0);", p);
#endif // NDB_ALPHA
#endif /* NDB_ALPHA */
#ifdef NDB_FORTE6
sparc_prefetch_write_once(p);
#else
......
......@@ -28,7 +28,7 @@ NdbDaemon_Make(const char* lockfile, const char* logfile, unsigned flags)
int lockfd = -1, logfd = -1, n;
char buf[64];
(void)flags; // remove warning for unused parameter
(void)flags; /* remove warning for unused parameter */
/* Check that we have write access to lock file */
assert(lockfile != NULL);
......
......@@ -42,7 +42,7 @@ void* NdbMem_Allocate(size_t size)
void* NdbMem_AllocateAlign(size_t size, size_t alignment)
{
(void)alignment; // remove warning for unused parameter
(void)alignment; /* remove warning for unused parameter */
/*
return (void*)memalign(alignment, size);
TEMP fix
......
......@@ -42,7 +42,7 @@ struct NdbThread* NdbThread_Create(NDB_THREAD_FUNC *p_thread_func,
int result;
pthread_attr_t thread_attr;
(void)thread_prio; // remove warning for unused parameter
(void)thread_prio; /* remove warning for unused parameter */
if (p_thread_func == NULL)
return 0;
......@@ -110,7 +110,7 @@ int NdbThread_SetConcurrencyLevel(int level)
#ifdef USE_PTHREAD_EXTRAS
return pthread_setconcurrency(level);
#else
(void)level; // remove warning for unused parameter
(void)level; /* remove warning for unused parameter */
return 0;
#endif
}
......@@ -90,7 +90,7 @@ void malloctest(int loopcount, int memsize, int touch) {
long long start=0;
int total=0;
int i=0, j=0;
int size=memsize*1024*1024; //bytes;
int size=memsize*1024*1024; /*bytes*/;
float mean;
char * ptr =0;
......@@ -126,7 +126,7 @@ void mmaptest(int loopcount, int memsize, int touch) {
int total=0;
int i=0, j=0;
char * ptr;
int size=memsize*1024*1024; //bytes;
int size=memsize*1024*1024; /*bytes*/;
float mean;
printf("Staring mmaptest ");
......@@ -165,7 +165,7 @@ void unmaptest(loopcount, memsize)
int total=0;
int i=0, j=0;
char * ptr;
int size=memsize*1024*1024; //bytes;
int size=memsize*1024*1024; /*bytes*/;
float mean;
printf("Staring munmap test (loopcount = 1 no matter what you prev. set)\n");
......@@ -215,7 +215,7 @@ void freetest(int loopcount, int memsize) {
long long start=0;
int total=0;
int i=0, j=0;
int size=memsize*1024*1024; //bytes;
int size=memsize*1024*1024; /*bytes*/;
float mean;
char * ptr =0;
......
......@@ -14,7 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
// define on IRIX to get posix compliant vsnprintf
/* define on IRIX to get posix compliant vsnprintf */
#define _XOPEN_SOURCE 500
#include <stdio.h>
#include <basestring_vsnprintf.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment