Attached patch has seen a make clean && make World on my machine. There remains
a signed / unsigned comparison issue, where an unsigned short is being read from
an RPC message and then assigned to either a uid_t or gid_t, which are then
compared to -1. This causes a warning when compiling the
lib/tt/lib/db/tt_old_db.C source file. Comparisons of uid_t and gid_t types
(which are unsigned on x86 Linux) to -1 occur elsewhere, but the warnings are
masked by casts. Not sure whether these comparisons are a problem or not.
Chris
From d849c0c2939795bab341436f00aa4db01d9edbe8 Mon Sep 17 00:00:00 2001
From: Chris Wareham <ch...@chriswareham.net>
Date: Tue, 14 Aug 2012 11:49:53 +0100
Subject: [PATCH] Fix most of the following classes of warnings in the
ToolTalk libraries:
- Const strings referenced by non-const variables.
- Incorrect format specifers for printing addresses
- Unused variables
- Signed comparison to unsigned
Also fix an incorrect enumeration value in a switch statement.
---
cde/lib/tt/lib/api/c/api_file.C | 2 +-
cde/lib/tt/lib/api/c/api_storage.C | 6 +++---
cde/lib/tt/lib/api/dnd/ttdnd.c | 2 --
cde/lib/tt/lib/db/db_server.h | 4 ++--
cde/lib/tt/lib/db/db_server_clnt.C | 6 +++---
cde/lib/tt/lib/db/old_db_server_functions.C | 2 +-
cde/lib/tt/lib/db/tt_db_client.C | 4 +---
cde/lib/tt/lib/db/tt_db_file.C | 2 +-
cde/lib/tt/lib/db/tt_db_key.C | 2 +-
cde/lib/tt/lib/db/tt_db_rpc_message_routines.C | 2 +-
cde/lib/tt/lib/db/tt_db_rpc_routines.C | 14 +++++++-------
cde/lib/tt/lib/mp/mp_auth.C | 16 ++++++++--------
cde/lib/tt/lib/mp/mp_auth_functions.C | 2 +-
cde/lib/tt/lib/mp/mp_auth_functions.h | 6 +++---
cde/lib/tt/lib/mp/mp_c_procid.C | 1 -
cde/lib/tt/lib/mp/mp_c_session.C | 1 -
cde/lib/tt/lib/mp/mp_pattern.C | 1 -
cde/lib/tt/lib/mp/mp_rpc_client.C | 2 --
cde/lib/tt/lib/tttk/ttdesktop.C | 2 ++
cde/lib/tt/lib/tttk/tttk2free.C | 6 +++---
cde/lib/tt/lib/util/tt_audit.C | 5 +++--
cde/lib/tt/lib/util/tt_audit.h | 2 +-
cde/lib/tt/lib/util/tt_enumname.C | 2 +-
cde/lib/tt/lib/util/tt_host.C | 2 +-
cde/lib/tt/lib/util/tt_host_equiv.C | 1 -
cde/lib/tt/lib/util/tt_trace.C | 7 ++++---
cde/lib/tt/lib/util/tt_trace.h | 2 +-
cde/lib/tt/lib/util/tt_trace_stream.C | 2 +-
cde/lib/tt/lib/util/tt_xdr_utils.C | 2 +-
29 files changed, 51 insertions(+), 57 deletions(-)
diff --git a/cde/lib/tt/lib/api/c/api_file.C b/cde/lib/tt/lib/api/c/api_file.C
index 0608ed5..643cc7f 100644
--- a/cde/lib/tt/lib/api/c/api_file.C
+++ b/cde/lib/tt/lib/api/c/api_file.C
@@ -416,7 +416,7 @@ extern "C" {
}
Tt_status
-_ttds_file_server(const char *filename, char **hostname)
+_ttds_file_server(const char *filename, const char **hostname)
{
_Tt_c_file_ptr file;
_Tt_db_results dbresults;
diff --git a/cde/lib/tt/lib/api/c/api_storage.C b/cde/lib/tt/lib/api/c/api_storage.C
index 298394b..45d53e8 100644
--- a/cde/lib/tt/lib/api/c/api_storage.C
+++ b/cde/lib/tt/lib/api/c/api_storage.C
@@ -173,13 +173,13 @@ void _Tt_api_stg_stack_elm::
print(FILE *f) const
{
- (void)fprintf(f,"_Tt_api_stg_stack_elm at %lx <",this);
+ (void)fprintf(f,"_Tt_api_stg_stack_elm at %p <",this);
switch (entry_type) {
case STACK_MARK:
- (void)fprintf(f,"mark %ld>\n",addr);
+ (void)fprintf(f,"mark %p>\n",addr);
break;
case STACK_STORAGE:
- (void)fprintf(f,"addr 0x%lx>\n",(long)addr);
+ (void)fprintf(f,"addr 0x%p>\n",addr);
break;
}
}
diff --git a/cde/lib/tt/lib/api/dnd/ttdnd.c b/cde/lib/tt/lib/api/dnd/ttdnd.c
index 256acb4..780028b 100644
--- a/cde/lib/tt/lib/api/dnd/ttdnd.c
+++ b/cde/lib/tt/lib/api/dnd/ttdnd.c
@@ -68,7 +68,6 @@ ttdnd_init(
{
int mark = tt_mark();
const char *t, **vt;
- int validtypecount, i;
if (tt_ptr_error(tt_open())>TT_WRN_LAST) {
@@ -238,7 +237,6 @@ _ttdnd_get_contents_callback(m, p)
Tt_message m;
Tt_pattern p;
{
- int xid;
int chunknumber;
int maxchunk;
char *type;
diff --git a/cde/lib/tt/lib/db/db_server.h b/cde/lib/tt/lib/db/db_server.h
index 6ac3e1d..63b66cb 100644
--- a/cde/lib/tt/lib/db/db_server.h
+++ b/cde/lib/tt/lib/db/db_server.h
@@ -276,7 +276,7 @@ bool_t xdr_Tt_oidaccess_results(XDR*, _Tt_oidaccess_results*);
struct _Tt_prop {
struct {
u_int propname_len;
- char *propname_val;
+ const char *propname_val;
} propname;
long recnum;
struct {
@@ -862,7 +862,7 @@ bool_t xdr_tt_garbage_collect_results(XDR *, _tt_garbage_collect_results *);
#include "db/tt_db_client_utils.h"
-extern int *_tt_min_auth_level_1(char**, CLIENT*, clnt_stat *status);
+extern int *_tt_min_auth_level_1(const char**, CLIENT*, clnt_stat *status);
extern _Tt_isam_results *_tt_isaddindex_1(_Tt_isaddindex_args*, CLIENT*);
extern _Tt_isam_results *_tt_isbuild_1(_Tt_isbuild_args*, CLIENT*);
extern _Tt_isam_results *_tt_isclose_1(int*, CLIENT*);
diff --git a/cde/lib/tt/lib/db/db_server_clnt.C b/cde/lib/tt/lib/db/db_server_clnt.C
index 2ba4c36..fe0320d 100644
--- a/cde/lib/tt/lib/db/db_server_clnt.C
+++ b/cde/lib/tt/lib/db/db_server_clnt.C
@@ -1138,7 +1138,7 @@ _tt_get_all_sessions_1(_tt_get_all_sessions_args *argp, CLIENT * clnt)
{
static _tt_get_all_sessions_results res;
- clnt_stat result = clnt_call(clnt, TT_GET_ALL_SESSIONS,
+ clnt_call(clnt, TT_GET_ALL_SESSIONS,
(xdrproc_t) xdr_tt_get_all_sessions_args,
(caddr_t) argp,
(xdrproc_t) xdr_tt_get_all_sessions_results,
@@ -1153,7 +1153,7 @@ _tt_garbage_collect_1(void * /*NOTUSED*/, CLIENT *clnt)
{
static _tt_garbage_collect_results res;
- clnt_stat result = clnt_call(clnt, TT_GARBAGE_COLLECT,
+ clnt_call(clnt, TT_GARBAGE_COLLECT,
(xdrproc_t) xdr_void, (caddr_t) NULL,
(xdrproc_t) xdr_tt_garbage_collect_results,
(caddr_t) &res,
@@ -1167,7 +1167,7 @@ _tt_delete_session_1(_tt_delete_session_args * args, CLIENT *clnt)
{
static _tt_delete_session_results res;
- clnt_stat result = clnt_call(clnt, TT_DELETE_SESSION,
+ clnt_call(clnt, TT_DELETE_SESSION,
(xdrproc_t) xdr_tt_delete_session_args,
(caddr_t) args,
(xdrproc_t) xdr_tt_delete_session_results,
diff --git a/cde/lib/tt/lib/db/old_db_server_functions.C b/cde/lib/tt/lib/db/old_db_server_functions.C
index 88a9556..795a88b 100644
--- a/cde/lib/tt/lib/db/old_db_server_functions.C
+++ b/cde/lib/tt/lib/db/old_db_server_functions.C
@@ -1523,7 +1523,7 @@ _tt_db_results *_tt_queue_message_1 (_tt_queue_msg_args *args,
_tt_get_rpc_strings(args->ptypes, message_info->ptypes);
// Get the XDR size of the new message info structure
- u_int length;
+ u_int length = 0;
if (!message_info->xdr((XDR *)xdrsz)) {
results = TT_DB_ERR_ILLEGAL_MESSAGE;
}
diff --git a/cde/lib/tt/lib/db/tt_db_client.C b/cde/lib/tt/lib/db/tt_db_client.C
index 5dfe913..24d369c 100644
--- a/cde/lib/tt/lib/db/tt_db_client.C
+++ b/cde/lib/tt/lib/db/tt_db_client.C
@@ -193,7 +193,7 @@ _Tt_db_results _Tt_db_client::connectToDB (const _Tt_string &hostname)
// If dbVersion == 1, then we are talking to an old DB server
static _tt_auth_level_results results;
- char *path = "";
+ const char *path = "";
clnt_stat rpc_status;
int *result = (int *)NULL;
result = _tt_min_auth_level_1(&path, dbServer, &rpc_status);
@@ -1247,7 +1247,6 @@ _Tt_db_client::dequeueMessages (const _Tt_string &file,
const _Tt_string_list_ptr &ptypes,
_Tt_message_list_ptr &messages)
{
- _Tt_db_results retval;
_tt_dequeue_msgs_args args;
args.file = (char *)file;
@@ -1265,7 +1264,6 @@ _Tt_db_client::dequeueMessages (const _Tt_string &file,
}
_tt_get_rpc_messages(results->messages, messages);
- retval = results->results;
if (dbVersion==1) {
_tt_free_rpc_messages(results->messages);
} else {
diff --git a/cde/lib/tt/lib/db/tt_db_file.C b/cde/lib/tt/lib/db/tt_db_file.C
index 15e4525..f3124f9 100644
--- a/cde/lib/tt/lib/db/tt_db_file.C
+++ b/cde/lib/tt/lib/db/tt_db_file.C
@@ -562,7 +562,7 @@ _Tt_string _Tt_db_file::getNetworkPath (const _Tt_string &file)
_Tt_string hostname;
_Tt_string partition;
- _Tt_db_results results = _tt_db_network_path(file,
+ _tt_db_network_path(file,
local_path,
hostname,
partition,
diff --git a/cde/lib/tt/lib/db/tt_db_key.C b/cde/lib/tt/lib/db/tt_db_key.C
index 5d5e8ff..5d9de81 100644
--- a/cde/lib/tt/lib/db/tt_db_key.C
+++ b/cde/lib/tt/lib/db/tt_db_key.C
@@ -44,7 +44,7 @@
_Tt_db_key::_Tt_db_key (short version_number)
{
- static long last_time_sec = 0;
+ static unsigned int last_time_sec = 0;
static long counter = 0;
key.version = version_number;
diff --git a/cde/lib/tt/lib/db/tt_db_rpc_message_routines.C b/cde/lib/tt/lib/db/tt_db_rpc_message_routines.C
index dde12b4..2f1e880 100644
--- a/cde/lib/tt/lib/db/tt_db_rpc_message_routines.C
+++ b/cde/lib/tt/lib/db/tt_db_rpc_message_routines.C
@@ -82,7 +82,7 @@ _tt_get_rpc_messages (const _tt_message_list &rpc_messages,
if (rpc_messages.messages_len) {
messages = new _Tt_message_list;
- for (int i=0; i < rpc_messages.messages_len; i++) {
+ for (unsigned int i=0; i < rpc_messages.messages_len; i++) {
_Tt_message_ptr message_ptr;
_tt_get_rpc_message(rpc_messages.messages_val [i],
diff --git a/cde/lib/tt/lib/db/tt_db_rpc_routines.C b/cde/lib/tt/lib/db/tt_db_rpc_routines.C
index db4a816..a7aa823 100644
--- a/cde/lib/tt/lib/db/tt_db_rpc_routines.C
+++ b/cde/lib/tt/lib/db/tt_db_rpc_routines.C
@@ -73,7 +73,7 @@ void _tt_free_rpc_message (const _tt_message &rpc_message)
void _tt_free_rpc_messages (const _tt_message_list &rpc_messages)
{
if (rpc_messages.messages_val) {
- for (int i=0; i < rpc_messages.messages_len; i++) {
+ for (unsigned int i=0; i < rpc_messages.messages_len; i++) {
_tt_free_rpc_message(rpc_messages.messages_val [i]);
}
@@ -84,7 +84,7 @@ void _tt_free_rpc_messages (const _tt_message_list &rpc_messages)
void _tt_free_rpc_strings (const _tt_string_list &rpc_strings)
{
if (rpc_strings.values_val) {
- for (int i=0; i < rpc_strings.values_len; i++) {
+ for (unsigned int i=0; i < rpc_strings.values_len; i++) {
if (rpc_strings.values_val [i].value) {
free(rpc_strings.values_val [i].value);
}
@@ -101,7 +101,7 @@ void _tt_free_rpc_property (const _tt_property &rpc_prop)
}
if (rpc_prop.values.values_val) {
- for (int i=0; i < rpc_prop.values.values_len; i++) {
+ for (unsigned int i=0; i < rpc_prop.values.values_len; i++) {
if (rpc_prop.values.values_val [i].value.value_val) {
free(rpc_prop.values.values_val [i].value.value_val);
}
@@ -114,7 +114,7 @@ void _tt_free_rpc_property (const _tt_property &rpc_prop)
void _tt_free_rpc_properties (const _tt_property_list &rpc_props)
{
if (rpc_props.properties_val) {
- for (int i=0; i < rpc_props.properties_len; i++) {
+ for (unsigned int i=0; i < rpc_props.properties_len; i++) {
_tt_free_rpc_property(rpc_props.properties_val [i]);
}
@@ -137,7 +137,7 @@ void _tt_get_rpc_strings (const _tt_string_list &rpc_strings,
strings = new _Tt_string_list;
if (rpc_strings.values_len) {
- for (int i=0; i < rpc_strings.values_len; i++) {
+ for (unsigned int i=0; i < rpc_strings.values_len; i++) {
(void)strings->append(_Tt_string(rpc_strings.values_val [i].value));
}
}
@@ -151,7 +151,7 @@ void _tt_get_rpc_property (const _tt_property &rpc_prop,
if (rpc_prop.name) {
prop->name = rpc_prop.name;
- for (int i=0; i < rpc_prop.values.values_len; i++) {
+ for (unsigned int i=0; i < rpc_prop.values.values_len; i++) {
int prop_value_length = rpc_prop.values.values_val [i].value.value_len;
if (prop_value_length) {
_Tt_string prop_value(prop_value_length);
@@ -171,7 +171,7 @@ void _tt_get_rpc_properties (const _tt_property_list &rpc_props,
props = new _Tt_db_property_list;
if (rpc_props.properties_len) {
- for (int i=0; i < rpc_props.properties_len; i++) {
+ for (unsigned int i=0; i < rpc_props.properties_len; i++) {
_Tt_db_property_ptr prop;
_tt_get_rpc_property (rpc_props.properties_val [i], prop);
diff --git a/cde/lib/tt/lib/mp/mp_auth.C b/cde/lib/tt/lib/mp/mp_auth.C
index 24ba925..458d57e 100644
--- a/cde/lib/tt/lib/mp/mp_auth.C
+++ b/cde/lib/tt/lib/mp/mp_auth.C
@@ -57,7 +57,7 @@ _Tt_auth::
Tt_status _Tt_auth::
generate_auth_cookie()
{
- static char *funcname = "_Tt_auth::make_auth_cookie()";
+ static const char *funcname = "_Tt_auth::make_auth_cookie()";
_tt_AuthFileEntry *entry;
int exists;
char *filename;
@@ -79,7 +79,7 @@ generate_auth_cookie()
_TT_ICEAUTH_DEFAULT_RETRIES,
_TT_ICEAUTH_DEFAULT_TIMEOUT,
_TT_ICEAUTH_DEFAULT_DEADTIME))) {
- char *reason = "unknown error";
+ const char *reason = "unknown error";
_tt_UnlockAuthFile(filename);
if (retval == _tt_AuthLockTimeout) {
@@ -151,7 +151,7 @@ cleanup:
Tt_status _Tt_auth::
read_auth_entries(FILE *fp, _tt_AuthFileEntryList **headp)
{
- static char *funcname = "_Tt_auth::read_auth_entries()";
+ static const char *funcname = "_Tt_auth::read_auth_entries()";
_tt_AuthFileEntry *entry;
_tt_AuthFileEntryList *head;
_tt_AuthFileEntryList *el_new;
@@ -189,7 +189,7 @@ read_auth_entries(FILE *fp, _tt_AuthFileEntryList **headp)
Tt_status _Tt_auth::
read_auth_file(char *filename)
{
- static char *funcname = "Tt_auth::read_auth_file()";
+ static const char *funcname = "Tt_auth::read_auth_file()";
FILE *authfp;
Tt_status status = TT_OK;
@@ -213,7 +213,7 @@ read_auth_file(char *filename)
Tt_status _Tt_auth::
modify_auth_entry(_tt_AuthFileEntry *entry, _tt_AuthFileEntryList **headp)
{
- static char *funcname = "Tt_auth::modify_auth_entry()";
+ static const char *funcname = "Tt_auth::modify_auth_entry()";
_tt_AuthFileEntryList *list, *prev, *el_new;
for (prev=NULL, list=*headp; list; list=list->next) {
@@ -253,8 +253,8 @@ modify_auth_entry(_tt_AuthFileEntry *entry, _tt_AuthFileEntryList **headp)
Tt_status _Tt_auth::
write_auth_file(char *filename)
{
- static char *funcname = "Tt_auth::write_auth_file()";
- static char *suffix = "-n";
+ static const char *funcname = "Tt_auth::write_auth_file()";
+ static const char *suffix = "-n";
FILE *fp;
_tt_AuthFileEntryList *list;
char *tmpnam;
@@ -300,7 +300,7 @@ retrieve_auth_cookie()
_tt_AuthFileEntry *entry = NULL;
entry = _tt_GetAuthFileEntry(_TT_ICEAUTH_PROTOCOL_NAME,
- (char*) _sessionid,
+ _sessionid,
_TT_ICEAUTH_AUTH_NAME);
if (NULL == entry)
return TT_AUTHFILE_ENTRY_MISSING;
diff --git a/cde/lib/tt/lib/mp/mp_auth_functions.C b/cde/lib/tt/lib/mp/mp_auth_functions.C
index 3e47e13..22f4473 100644
--- a/cde/lib/tt/lib/mp/mp_auth_functions.C
+++ b/cde/lib/tt/lib/mp/mp_auth_functions.C
@@ -340,7 +340,7 @@ _tt_WriteAuthFileEntry(FILE *auth_file, _tt_AuthFileEntry *auth)
_tt_AuthFileEntry *
-_tt_GetAuthFileEntry(char *protocol_name, char *network_id, char *auth_name)
+_tt_GetAuthFileEntry(const char *protocol_name, const char *network_id, const char *auth_name)
{
FILE *auth_file;
char *filename;
diff --git a/cde/lib/tt/lib/mp/mp_auth_functions.h b/cde/lib/tt/lib/mp/mp_auth_functions.h
index 47f34bb..020c463 100644
--- a/cde/lib/tt/lib/mp/mp_auth_functions.h
+++ b/cde/lib/tt/lib/mp/mp_auth_functions.h
@@ -126,9 +126,9 @@ extern int _tt_WriteAuthFileEntry (
);
extern _tt_AuthFileEntry *_tt_GetAuthFileEntry (
- char * /* protocol_name */,
- char * /* network_id */,
- char * /* auth_name */
+ const char * /* protocol_name */,
+ const char * /* network_id */,
+ const char * /* auth_name */
);
extern char *_tt_GenerateMagicCookie (
diff --git a/cde/lib/tt/lib/mp/mp_c_procid.C b/cde/lib/tt/lib/mp/mp_c_procid.C
index 92b3a05..7c7561a 100644
--- a/cde/lib/tt/lib/mp/mp_c_procid.C
+++ b/cde/lib/tt/lib/mp/mp_c_procid.C
@@ -340,7 +340,6 @@ commit()
Tt_status _Tt_c_procid::
init()
{
- int rpc_version = TT_RPC_VERSION;
Tt_status status;
if (_default_session.is_null()) {
diff --git a/cde/lib/tt/lib/mp/mp_c_session.C b/cde/lib/tt/lib/mp/mp_c_session.C
index 78a3753..3cab78a 100644
--- a/cde/lib/tt/lib/mp/mp_c_session.C
+++ b/cde/lib/tt/lib/mp/mp_c_session.C
@@ -79,7 +79,6 @@ c_init()
{
_Tt_string start_ttcmd;
int tried = 0;
- int done = 0;
Tt_status status;
if (env() == _TT_ENV_X11) {
diff --git a/cde/lib/tt/lib/mp/mp_pattern.C b/cde/lib/tt/lib/mp/mp_pattern.C
index dc89c15..2ed3e9d 100644
--- a/cde/lib/tt/lib/mp/mp_pattern.C
+++ b/cde/lib/tt/lib/mp/mp_pattern.C
@@ -222,7 +222,6 @@ _Tt_pattern::add_netfile(
)
{
_Tt_string abspath;
- Tt_status status = TT_OK;
int __scopes = scopes();
if ((__scopes&(1<<TT_FILE)) || (__scopes&(1<<TT_BOTH))) {
diff --git a/cde/lib/tt/lib/mp/mp_rpc_client.C b/cde/lib/tt/lib/mp/mp_rpc_client.C
index e1e8be2..82697ec 100644
--- a/cde/lib/tt/lib/mp/mp_rpc_client.C
+++ b/cde/lib/tt/lib/mp/mp_rpc_client.C
@@ -123,8 +123,6 @@ init(_Tt_host_ptr &host, int program, int version,
uid_t servuid, _Tt_auth &auth)
{
int optval;
- static caddr_t saved_opaque = 0;
- static int saved_len = 0;
optval = (_socket == RPC_ANYSOCK);
_auth = auth;
diff --git a/cde/lib/tt/lib/tttk/ttdesktop.C b/cde/lib/tt/lib/tttk/ttdesktop.C
index 3650d4c..6a38af2 100644
--- a/cde/lib/tt/lib/tttk/ttdesktop.C
+++ b/cde/lib/tt/lib/tttk/ttdesktop.C
@@ -1659,7 +1659,9 @@ _ttdt_posix_cb(
char *categoryName, *variable, *value;
int category, i;
struct utsname names;
+#if defined(OPT_SYSINFO)
char buf[ SYS_NMLN ];
+#endif
case TTDT_SET_LOCALE:
return _ttDtGetLocaleCB( msg, pat, (void *)_ttDtApplyLocale, 0 );
case TTDT_GET_LOCALE:
diff --git a/cde/lib/tt/lib/tttk/tttk2free.C b/cde/lib/tt/lib/tttk/tttk2free.C
index e9a54a9..0ecde10 100644
--- a/cde/lib/tt/lib/tttk/tttk2free.C
+++ b/cde/lib/tt/lib/tttk/tttk2free.C
@@ -127,7 +127,7 @@ _TttkList2Free::_TttkList2Free(
if (_items == 0) {
_max = 0;
}
- for (int i = 0; i < _max; i++) {
+ for (unsigned int i = 0; i < _max; i++) {
_items[ i ] = new _TttkItem2Free();
if (_items[ i ] == 0) {
_destruct();
@@ -188,7 +188,7 @@ _TttkList2Free::operator +=(
void
_TttkList2Free::flush()
{
- for (int i = 0; i < _num; i++) {
+ for (unsigned int i = 0; i < _num; i++) {
_item( i ) = (caddr_t)0;
}
}
@@ -200,7 +200,7 @@ _TttkList2Free::_destruct()
#ifdef OPT_VECNEW
delete [] _items;
#else
- for (int i = 0; i < _max; i++) {
+ for (unsigned int i = 0; i < _max; i++) {
if (_items[ i ] != 0) {
delete _items[ i ];
_items[ i ] = 0;
diff --git a/cde/lib/tt/lib/util/tt_audit.C b/cde/lib/tt/lib/util/tt_audit.C
index e850939..426ba42 100644
--- a/cde/lib/tt/lib/util/tt_audit.C
+++ b/cde/lib/tt/lib/util/tt_audit.C
@@ -63,10 +63,11 @@ void *_tt_error_pointer(Tt_status s);
// loop iteration. All this in the name of coding efficiency.
//
Tt_status _Tt_audit::
-entry(char *argskey, _Tt_entry_pt func, ...)
+entry(const char *argskey, _Tt_entry_pt func, ...)
{
va_list ap;
- char c, *preview, *cp;
+ char c, *cp;
+ const char *preview;
int num_args = strlen(argskey);
Tt_message m;
_Tt_c_message_ptr msg;
diff --git a/cde/lib/tt/lib/util/tt_audit.h b/cde/lib/tt/lib/util/tt_audit.h
index a195206..cb747cb 100644
--- a/cde/lib/tt/lib/util/tt_audit.h
+++ b/cde/lib/tt/lib/util/tt_audit.h
@@ -40,6 +40,6 @@
class _Tt_audit: public _Tt_trace {
public:
- Tt_status entry(char *argskey, _Tt_entry_pt func, ...);
+ Tt_status entry(const char *argskey, _Tt_entry_pt func, ...);
};
#endif /* TT_AUDIT_H */
diff --git a/cde/lib/tt/lib/util/tt_enumname.C b/cde/lib/tt/lib/util/tt_enumname.C
index b8aac1d..1ba183f 100644
--- a/cde/lib/tt/lib/util/tt_enumname.C
+++ b/cde/lib/tt/lib/util/tt_enumname.C
@@ -286,7 +286,7 @@ const char *
_tt_enumname(Tt_feature x) {
switch (x) {
TTC(TT_FEATURE_MULTITHREADED);
- case TT_STATE_LAST:
+ case _TT_FEATURE_LAST:
default:
return "! Tt_feature";
}
diff --git a/cde/lib/tt/lib/util/tt_host.C b/cde/lib/tt/lib/util/tt_host.C
index 5590c8f..60e8051 100644
--- a/cde/lib/tt/lib/util/tt_host.C
+++ b/cde/lib/tt/lib/util/tt_host.C
@@ -177,7 +177,7 @@ init_bystringaddr(_Tt_string addr)
ip_address = &ip_address_buf;
*ip_address = inet_addr((char *)addr);
- if (*ip_address == -1) {
+ if (*ip_address == INADDR_NONE) {
return(0);
}
diff --git a/cde/lib/tt/lib/util/tt_host_equiv.C b/cde/lib/tt/lib/util/tt_host_equiv.C
index dec527b..978a92d 100644
--- a/cde/lib/tt/lib/util/tt_host_equiv.C
+++ b/cde/lib/tt/lib/util/tt_host_equiv.C
@@ -307,7 +307,6 @@ _cache_it(_Tt_hostname_cache_ptr cache_ptr, _Tt_string & hostname)
_Tt_hostname_cache_ptr sh, lh;
struct hostent *host_ret;
_Xgethostbynameparams host_buf;
- int failed = 0;
char **h_addr_list;
diff --git a/cde/lib/tt/lib/util/tt_trace.C b/cde/lib/tt/lib/util/tt_trace.C
index 2fb9c04..816b8cd 100644
--- a/cde/lib/tt/lib/util/tt_trace.C
+++ b/cde/lib/tt/lib/util/tt_trace.C
@@ -271,7 +271,7 @@ _Tt_trace::entry(
(*_pstream)->set_is_entered(0);
}
- const char *s;
+ const char *s = 0;
int printmsg = 1;
//
// We do not print msg if it is a (often incomplete) update
@@ -347,7 +347,7 @@ _Tt_trace::entry(
//
void
_Tt_trace::entry(
- char *argskey,
+ const char *argskey,
_Tt_entry_pt func,
va_list ap
)
@@ -373,7 +373,8 @@ _Tt_trace::entry(
(*_pstream)->set_is_entered(0);
}
- char c, *preview;
+ char c;
+ const char *preview;
int num_args = strlen(argskey);
// print the API name and open paren
diff --git a/cde/lib/tt/lib/util/tt_trace.h b/cde/lib/tt/lib/util/tt_trace.h
index 4b13801..2a049e9 100644
--- a/cde/lib/tt/lib/util/tt_trace.h
+++ b/cde/lib/tt/lib/util/tt_trace.h
@@ -130,7 +130,7 @@ class _Tt_trace : public _Tt_allocated {
// API tracing entry call
void entry(
- char *argskey,
+ const char *argskey,
_Tt_entry_pt func,
va_list ap
);
diff --git a/cde/lib/tt/lib/util/tt_trace_stream.C b/cde/lib/tt/lib/util/tt_trace_stream.C
index 72aed92..fefc45e 100644
--- a/cde/lib/tt/lib/util/tt_trace_stream.C
+++ b/cde/lib/tt/lib/util/tt_trace_stream.C
@@ -138,7 +138,7 @@ operator <<(
os << _tt_enumname( msg.message_class() );
os << " <" << msg.api_id() << "> ";
os << _tt_enumname( msg.state() );
- char *conjunction = " because ";
+ const char *conjunction = " because ";
switch (msg.state()) {
case TT_CREATED:
case TT_SENT:
diff --git a/cde/lib/tt/lib/util/tt_xdr_utils.C b/cde/lib/tt/lib/util/tt_xdr_utils.C
index 833c119..d43f9d9 100644
--- a/cde/lib/tt/lib/util/tt_xdr_utils.C
+++ b/cde/lib/tt/lib/util/tt_xdr_utils.C
@@ -129,7 +129,7 @@ _tt_xdr_sizeof(xdrproc_t f, void *data)
_Tt_xdr_size_stream::
_Tt_xdr_size_stream() {
- memset ((char *)&ops, 0, sizeof ops);
+ memset (&ops, 0, sizeof ops);
#if defined(OPT_BUG_SUNOS_4) || defined(OPT_BUG_HPUX)
ops.x_putlong = (int (*)(...))tt_x_putlong;
ops.x_putbytes = (int (*)(...))tt_x_putbytes;
--
1.7.11.2
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
cdesktopenv-devel mailing list
cdesktopenv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdesktopenv-devel