Merge branch 'master' of https://git.code.sf.net/p/cdesktopenv/code
This commit is contained in:
@@ -314,10 +314,8 @@ int DtSearchInit (
|
||||
aa_argv0 = argv0;
|
||||
if (err_file)
|
||||
aa_stderr = err_file;
|
||||
#if defined(linux) || defined(CSRG_BASED)
|
||||
else
|
||||
aa_stderr = stderr;
|
||||
#endif
|
||||
|
||||
sprintbuf = austext_malloc (SPRINTBUFSZ, PROGNAME "135", NULL);
|
||||
|
||||
|
||||
@@ -60,11 +60,7 @@
|
||||
#include <stdio.h>
|
||||
#include <nl_types.h>
|
||||
|
||||
#if defined(linux)
|
||||
FILE *aa_stderr = NULL;
|
||||
#else
|
||||
FILE *aa_stderr = stderr;
|
||||
#endif
|
||||
char *aa_argv0 = "<argv0>";
|
||||
nl_catd dtsearch_catd = (nl_catd) -1;
|
||||
nl_catd austools_catd = (nl_catd) -1;
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
# define __SVR4_I386_ABI_L1__
|
||||
#endif
|
||||
#include <limits.h> /* pickup WORD_BIT, LONG_BIT */
|
||||
#if defined(linux)
|
||||
#if defined(linux) || defined(__FreeBSD__)
|
||||
# undef __SVR4_I386_ABI_L1__
|
||||
# ifndef WORD_BIT
|
||||
# define WORD_BIT 32
|
||||
|
||||
@@ -109,6 +109,10 @@ LinkFile(TermPrimGetPty.c,TermPrimGetPty-svr4.c)
|
||||
LinkFile(TermPrimGetPty.c,TermPrimGetPty-svr4.c)
|
||||
#endif
|
||||
|
||||
#ifdef FreeBSDArchitecture
|
||||
LinkFile(TermPrimGetPty.c,TermPrimGetPty-bsd.c)
|
||||
#endif
|
||||
|
||||
#ifdef OpenBSDArchitecture
|
||||
LinkFile(TermPrimGetPty.c,TermPrimGetPty-bsd.c)
|
||||
#endif
|
||||
|
||||
@@ -39,10 +39,10 @@ static char rcs_id[] = "$XConsortium: TermPrimDebug.c /main/4 1996/11/21 19:58:1
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#if !defined(linux)
|
||||
# include <varargs.h>
|
||||
#else
|
||||
#if defined(linux) || defined(CSRG_BASED)
|
||||
# include <stdarg.h>
|
||||
#else
|
||||
# include <varargs.h>
|
||||
#endif
|
||||
#include "TermHeader.h"
|
||||
#include "TermPrimDebug.h"
|
||||
|
||||
@@ -96,11 +96,11 @@
|
||||
# define USE_TCSENDBREAK /* use tiocbreak() */
|
||||
#endif /* LINUX_ARCHITECTURE */
|
||||
|
||||
#ifdef OPENBSD_ARCHITECTURE
|
||||
#ifdef CSRG_BASED
|
||||
# define HAS_SETEUID /* seteuid available */
|
||||
# define HAS_SETREUID /* setreuid available */
|
||||
# define USE_TCSENDBREAK /* use tiocbreak() */
|
||||
#endif /* OPENBSD_ARCHITECTURE */
|
||||
#endif /* CSRG_BASED */
|
||||
|
||||
#ifdef SUN_ARCHITECTURE
|
||||
# define XOR_CAPS_LOCK /* xor caps lock and shift */
|
||||
|
||||
@@ -60,6 +60,12 @@ static char rcs_id[] = "$TOG: TermPrimSetUtmp.c /main/10 1998/04/03 17:11:42 mgr
|
||||
#define UT_NO_pututline
|
||||
#endif /* sun */
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
#define UT_UTMPX
|
||||
#define UT_HOST ut_host
|
||||
#define UT_NO_pututline
|
||||
#endif
|
||||
|
||||
#ifdef sun
|
||||
#define UT_UTMPX
|
||||
#define UT_HOST ut_host
|
||||
|
||||
@@ -15,7 +15,7 @@ XCOMM $XConsortium: Imakefile /main/8 1996/04/21 19:11:16 drk $
|
||||
DEFINES = DtWidgetDefines
|
||||
#if defined(LinuxArchitecture)
|
||||
INCLUDES = -I. -I/usr/include/freetype2
|
||||
#elif defined(OpenBSDArchitecture)
|
||||
#elif defined(OpenBSDArchitecture) || defined(FreeBSDArchitecture)
|
||||
INCLUDES = -I. -I$(XPROJECTROOT)/include/freetype2
|
||||
#else
|
||||
INCLUDES = -I.
|
||||
|
||||
@@ -105,12 +105,6 @@ rtable3_clnt.c rtable3_xdr.c: rtable3.h namechange1.sed namechange2.sed
|
||||
rtable2_clnt.c rtable2_xdr.c: rtable3.h namechange1.sed namechange2.sed
|
||||
agent_xdr.c agent.c: agent.h
|
||||
|
||||
#ifdef LinuxArchitecture
|
||||
EXTRASED=sed -e 's/update_failed.*=.*1,.*/update_failed = 1/g' |
|
||||
#else
|
||||
EXTRASED=
|
||||
#endif
|
||||
|
||||
agent.h:
|
||||
$(RM) $@
|
||||
cat agent.wrapbegin > agent.h
|
||||
|
||||
@@ -156,15 +156,15 @@ _DtCm_init_agent()
|
||||
}
|
||||
|
||||
if (registerrpc(_DtCm_transient, AGENTVERS, update_callback,
|
||||
(char *(*)())_DtCm_update_callback_1, _DtCm_xdr_Table_Res_4,
|
||||
_DtCm_xdr_Update_Status) == -1) {
|
||||
(char *(*)())_DtCm_update_callback_1, (xdrproc_t)_DtCm_xdr_Table_Res_4,
|
||||
(xdrproc_t)_DtCm_xdr_Update_Status) == -1) {
|
||||
_DtCm_print_errmsg("Cannot register v1 callback handler\n");
|
||||
_DtCm_print_errmsg("Callback cannot be enabled.\n");
|
||||
}
|
||||
|
||||
if (registerrpc(_DtCm_transient, AGENTVERS_2, CMCB_UPDATE_CALLBACK,
|
||||
(char *(*)())cmcb_update_callback_2_svc,
|
||||
xdr_cmcb_update_callback_args, xdr_void) == -1) {
|
||||
(xdrproc_t)xdr_cmcb_update_callback_args, (xdrproc_t)xdr_void) == -1) {
|
||||
_DtCm_print_errmsg("Cannot register v2 callback handler\n");
|
||||
_DtCm_print_errmsg("Callback cannot be enabled.\n");
|
||||
}
|
||||
@@ -296,7 +296,7 @@ _DtCm_process_updates()
|
||||
*/
|
||||
|
||||
Update_Status *
|
||||
_DtCm_update_callback_1(Table_Res_4 *t, void *dummy)
|
||||
_DtCm_update_callback_1(Table_Res_4 *t, _DtCm_Connection *conn)
|
||||
{
|
||||
static Update_Status status = update_succeeded;
|
||||
_CallbackInfo *cbi;
|
||||
|
||||
@@ -4,11 +4,3 @@
|
||||
#if defined(HPUX)
|
||||
#include <rpc/types.h>
|
||||
#endif /* HPUX */
|
||||
|
||||
#if defined(linux) || defined(CSRG_BASED)
|
||||
# if defined __STDC__
|
||||
# define REDEFINE_STDC
|
||||
# undef __STDC__
|
||||
# endif
|
||||
#endif /* linux */
|
||||
|
||||
|
||||
@@ -3,10 +3,3 @@
|
||||
#define hpux
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(linux)
|
||||
# if defined REDEFINE_STDC
|
||||
# undef REDEFINE_STDC
|
||||
# define __STDC__
|
||||
# endif
|
||||
#endif /* linux */
|
||||
|
||||
@@ -32,6 +32,6 @@ enum Update_Status {
|
||||
*/
|
||||
program AGENTPROG {
|
||||
version AGENTVERS {
|
||||
Update_Status update_callback(Table_Res) = 1;
|
||||
Update_Status update_callback(Table_Res_4) = 1;
|
||||
}=1;
|
||||
}=00;
|
||||
|
||||
@@ -997,7 +997,7 @@ csa_list_entry_sequence(
|
||||
rtype = &entry->e->attrs[CSA_ENTRY_ATTR_RECURRENCE_RULE_I];
|
||||
if (rtype->value == NULL ||
|
||||
rtype->value->item.string_value == NULL ||
|
||||
*(rtype->value->item.string_value) == NULL) {
|
||||
*(rtype->value->item.string_value) == '\0' ) {
|
||||
return (CSA_E_INVALID_PARAMETER);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1907,8 +1907,8 @@ _CheckNameAtHost(char *owner, char *value)
|
||||
return (CSA_E_FAILURE);
|
||||
}
|
||||
|
||||
if (optr = strchr(owner, '@')) *optr = NULL;
|
||||
if (ptr = strchr(value, '@')) *ptr = NULL;
|
||||
if (optr = strchr(owner, '@')) *optr = '\0';
|
||||
if (ptr = strchr(value, '@')) *ptr = '\0';
|
||||
res = strcmp(value, owner);
|
||||
if (optr) *optr = '@';
|
||||
if (ptr) *ptr = '@';
|
||||
@@ -1965,7 +1965,7 @@ _CheckCalendarName(char *owner, char *cname, cms_attribute_value *val)
|
||||
/* now make sure if cal name is a user name, it's
|
||||
* the same as that of the calling user
|
||||
*/
|
||||
if (ptr = strchr(val->item.string_value, '@')) *ptr = NULL;
|
||||
if (ptr = strchr(val->item.string_value, '@')) *ptr = '\0';
|
||||
isuser = _DtCmIsUserName(val->item.string_value);
|
||||
if (ptr) *ptr = '@';
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ _DtCm_new_Calendar(const char *calendar)
|
||||
if ((cal = (Calendar *)malloc(sizeof(Calendar))) == NULL)
|
||||
return(NULL);
|
||||
|
||||
memset((void *)cal, NULL, sizeof(Calendar));
|
||||
memset((void *)cal, 0, sizeof(Calendar));
|
||||
|
||||
if ((cal->name = strdup(calendar)) == NULL) {
|
||||
free(cal);
|
||||
@@ -305,7 +305,7 @@ _DtCm_list_old_cal_attr_names(
|
||||
for (i = 1, j = 0; i <= _DtCM_DEFINED_CAL_ATTR_SIZE; i++) {
|
||||
if (_CSA_cal_attr_info[i].fst_vers > 0 &&
|
||||
_CSA_cal_attr_info[i].fst_vers <= cal->file_version) {
|
||||
if (i == CSA_CAL_ATTR_CALENDAR_OWNER_I && *buf == NULL)
|
||||
if (i == CSA_CAL_ATTR_CALENDAR_OWNER_I && *buf == '\0')
|
||||
continue;
|
||||
|
||||
if ((names[j] =
|
||||
@@ -527,7 +527,7 @@ _get_owner_from_old_cal(Calendar *cal, char *owner)
|
||||
if (_DtCmIsUserName(calname) == B_TRUE)
|
||||
strcpy(owner, calname);
|
||||
else
|
||||
*owner = NULL;
|
||||
*owner = '\0';
|
||||
|
||||
free(calname);
|
||||
return (CSA_SUCCESS);
|
||||
@@ -555,7 +555,7 @@ _get_calendar_owner(
|
||||
} else {
|
||||
if ((stat = _get_owner_from_old_cal(cal, buf)) != CSA_SUCCESS)
|
||||
return (stat);
|
||||
else if (*buf == NULL)
|
||||
else if (*buf == '\0')
|
||||
return (CSA_SUCCESS);
|
||||
else
|
||||
owner = buf;
|
||||
|
||||
@@ -164,7 +164,7 @@ _DtCmGrowAttrArray(uint *num_attrs, cms_attribute **attrs, cms_attribute *attr)
|
||||
return (CSA_E_INSUFFICIENT_MEMORY);
|
||||
else {
|
||||
*attrs = newptr;
|
||||
memset((void *)&(*attrs)[*num_attrs+1], NULL,
|
||||
memset((void *)&(*attrs)[*num_attrs+1], 0,
|
||||
sizeof(cms_attribute) * (index - *num_attrs));
|
||||
}
|
||||
|
||||
|
||||
@@ -378,7 +378,7 @@ _DtCmAttr4ToReminderValue(
|
||||
_csa_duration_to_iso8601(atoi(remval->value), timestr);
|
||||
rval.lead_time = timestr;
|
||||
|
||||
if (remval->clientdata && *remval->clientdata != NULL) {
|
||||
if (remval->clientdata && *remval->clientdata != '\0') {
|
||||
rval.reminder_data.size = strlen(remval->clientdata);
|
||||
rval.reminder_data.data = (unsigned char *)remval->clientdata;
|
||||
} else {
|
||||
|
||||
@@ -92,11 +92,11 @@ _DtCm_cmsattrs_to_apptdata(uint size, cms_attribute *attrs, Appt_4 *appt)
|
||||
{
|
||||
strncpy(buf, (char *)aptr->value->item.opaque_data_value->data,
|
||||
aptr->value->item.opaque_data_value->size);
|
||||
buf[aptr->value->item.opaque_data_value->size] = NULL;
|
||||
buf[aptr->value->item.opaque_data_value->size] = '\0';
|
||||
|
||||
ptr = strchr(buf, ':');
|
||||
if (ptr != NULL)
|
||||
*ptr = NULL;
|
||||
*ptr = '\0';
|
||||
|
||||
appt->appt_id.key = atol(buf);
|
||||
|
||||
@@ -819,7 +819,7 @@ _DtCm_add_reminder(char *rem, CSA_reminder * val, Appt_4 *appt)
|
||||
}
|
||||
memcpy(newattr->clientdata, val->reminder_data.data,
|
||||
val->reminder_data.size);
|
||||
newattr->clientdata[val->reminder_data.size] = NULL;
|
||||
newattr->clientdata[val->reminder_data.size] = '\0';
|
||||
|
||||
} else if ((newattr->clientdata = calloc(1,1)) == NULL) {
|
||||
_DtCm_free_attr4(newattr);
|
||||
|
||||
@@ -578,7 +578,7 @@ _DtCm_free_entry_content(uint dummy, _DtCm_libentry *entry)
|
||||
{
|
||||
_DtCm_remove_from_entry_list(entry->cal, (caddr_t)entry, (caddr_t)entry);
|
||||
if (entry->e) _DtCm_free_cms_entry(entry->e);
|
||||
memset((void *)entry, NULL, sizeof(_DtCm_libentry));
|
||||
memset((void *)entry, 0, sizeof(_DtCm_libentry));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -611,7 +611,7 @@ _DtCm_free_libentries(_DtCm_libentry *entry)
|
||||
nptr = entry->next;
|
||||
|
||||
if (entry->e) _DtCm_free_cms_entry(entry->e);
|
||||
memset((void *)entry, NULL, sizeof(_DtCm_libentry));
|
||||
memset((void *)entry, 0, sizeof(_DtCm_libentry));
|
||||
|
||||
free(entry);
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
|
||||
#include <EUSCompat.h>
|
||||
#include "ansi_c.h"
|
||||
#include <sys/types.h>
|
||||
|
||||
extern CSA_calendar_user *_DtCm_alloc_calendar_users(uint num_elem);
|
||||
|
||||
|
||||
@@ -318,7 +318,7 @@ _csa_iso8601_to_duration(char *buf, time_t *sec)
|
||||
numptr = ptr;
|
||||
while (*ptr >= '0' && *ptr <= '9') ptr++;
|
||||
|
||||
if (numptr == ptr || !(*ptr && *ptr++ == 'S' && *ptr == NULL))
|
||||
if (numptr == ptr || !(*ptr && *ptr++ == 'S' && *ptr == '\0'))
|
||||
return (-1);
|
||||
else {
|
||||
num = atoi(numptr);
|
||||
|
||||
@@ -215,10 +215,10 @@ match_forward(char *str1, char *str2)
|
||||
get_component(&str2, com2, '.');
|
||||
|
||||
if (*com1) {
|
||||
if (*com2 == NULL)
|
||||
if (*com2 == '\0')
|
||||
return (B_TRUE);
|
||||
} else {
|
||||
if (*com2 == NULL)
|
||||
if (*com2 == '\0')
|
||||
return (B_TRUE);
|
||||
else
|
||||
return (B_FALSE);
|
||||
@@ -229,18 +229,18 @@ match_forward(char *str1, char *str2)
|
||||
|
||||
/* take care of case: a.b a. */
|
||||
if (strcmp(str2, ".") == 0
|
||||
&& (strcmp(str1, ".") != 0 || *str1 != NULL))
|
||||
&& (strcmp(str1, ".") != 0 || *str1 != '\0'))
|
||||
return (B_FALSE);
|
||||
|
||||
/* skip "." */
|
||||
if (*str1 == '.') {
|
||||
if (*str2 == NULL)
|
||||
if (*str2 == '\0')
|
||||
return (B_TRUE);
|
||||
else {
|
||||
str1++;
|
||||
str2++;
|
||||
}
|
||||
} else if (strcmp(str2, ".") == 0 || *str2 == NULL)
|
||||
} else if (strcmp(str2, ".") == 0 || *str2 == '\0')
|
||||
return (B_TRUE);
|
||||
else
|
||||
return (B_FALSE);
|
||||
@@ -278,10 +278,10 @@ match_backward(char *str1, char *str2)
|
||||
get_last_component(str2, &ptr2, com2, '.');
|
||||
|
||||
if (*com1) {
|
||||
if (*com2 == NULL)
|
||||
if (*com2 == '\0')
|
||||
return (B_TRUE);
|
||||
} else {
|
||||
if (*com2 == NULL)
|
||||
if (*com2 == '\0')
|
||||
return (B_TRUE);
|
||||
else
|
||||
return (B_FALSE);
|
||||
|
||||
@@ -69,7 +69,7 @@ _DtCmGetPrefix(char *str, char sep)
|
||||
if (ptr == buf)
|
||||
return(NULL);
|
||||
else {
|
||||
*ptr = NULL;
|
||||
*ptr = '\0';
|
||||
return(strdup(buf));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1134,15 +1134,15 @@ contain_substr(char *str1, char *str2)
|
||||
{
|
||||
int i, len;
|
||||
|
||||
if (str2 == NULL || *str2 == NULL)
|
||||
if (str2 == NULL || *str2 == '\0')
|
||||
return (B_TRUE);
|
||||
|
||||
if (str1 == NULL || *str1 == NULL) {
|
||||
if (str1 == NULL || *str1 == '\0') {
|
||||
return (B_FALSE);
|
||||
} else {
|
||||
len = strlen(str2);
|
||||
|
||||
for (i = 0; str1[i] != NULL; i++) {
|
||||
for (i = 0; str1[i] != '\0'; i++) {
|
||||
if (strncasecmp(&str1[i], str2, len) == 0)
|
||||
return (B_TRUE);
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ _DtCm_add_name_to_table(_DtCmNameTable *tbl, int index, char *newname)
|
||||
return (CSA_E_INSUFFICIENT_MEMORY);
|
||||
} else {
|
||||
tbl->names = newptr;
|
||||
memset((void *)&tbl->names[tbl->size+1], NULL,
|
||||
memset((void *)&tbl->names[tbl->size+1], 0,
|
||||
sizeof(char *)*(index - tbl->size));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -435,12 +435,12 @@ occurrence : FIRSTWEEK endMarker
|
||||
|
||||
endDate : /* empty */
|
||||
{
|
||||
$$ = NULL;
|
||||
$$ = '\0';
|
||||
}
|
||||
| DATE
|
||||
{
|
||||
if (_csa_iso8601_to_tick($1, &$$) == -1)
|
||||
$$ = NULL;
|
||||
$$ = '\0';
|
||||
}
|
||||
;
|
||||
|
||||
|
||||
@@ -226,7 +226,7 @@ _DtCm_rpc_create_calendar(
|
||||
/* check to make sure user is not creating a calendar
|
||||
* using another user's name
|
||||
*/
|
||||
if (ptr = strchr(cal->name, '@')) *ptr = NULL;
|
||||
if (ptr = strchr(cal->name, '@')) *ptr = '\0';
|
||||
if (_DtCmIsUserName(cal->name) == B_TRUE) {
|
||||
|
||||
if ((owner = _DtCmGetUserName()) == NULL)
|
||||
@@ -1412,7 +1412,7 @@ _GetV4UserAccess(Calendar *cal, cms_access_entry *alist)
|
||||
boolean_t isowner = B_FALSE;
|
||||
|
||||
/* first check if user is owner */
|
||||
if (ptr = strchr(cal->name, '@')) *ptr = NULL;
|
||||
if (ptr = strchr(cal->name, '@')) *ptr = '\0';
|
||||
|
||||
if (_DtCmIsUserName(cal->name) == B_TRUE) {
|
||||
if (strcmp(user, cal->name) == 0) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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],
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -793,8 +793,17 @@ set_id(char *id)
|
||||
if (sscanf((char *)id, "X %s %d", host, &svnum) != 2) {
|
||||
return(TT_ERR_SESSION);
|
||||
}
|
||||
/* We _cannot_ set _displayname based solely on host and svnum,
|
||||
* because :0 is NOT the same as 127.0.0.1:0 as far as X11
|
||||
* is concerned: by default, it will only accept connections
|
||||
* to the former. (XOpenDisplay etc. will fail if you try the below!)
|
||||
sprintf(dpname, "%s:%d", host, svnum);
|
||||
_displayname = dpname;
|
||||
*/
|
||||
if (! _displayname.len()) {
|
||||
_displayname = _tt_global->xdisplayname;
|
||||
}
|
||||
|
||||
_server_num = svnum;
|
||||
_env = _TT_ENV_X11;
|
||||
break;
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
);
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user