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.
This commit is contained in:
committed by
Jon Trulson
parent
d6b6353f95
commit
e738704385
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 (
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
@@ -79,7 +79,6 @@ c_init()
|
||||
{
|
||||
_Tt_string start_ttcmd;
|
||||
int tried = 0;
|
||||
int done = 0;
|
||||
Tt_status status;
|
||||
|
||||
if (env() == _TT_ENV_X11) {
|
||||
|
||||
@@ -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))) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user