I fix some pointer casting and printf format warnings for 64bit support.
There are many problems about code convention like indentations,
whitespaces, tabs, and so on. These should be aligned later, not this
commit.
Change-Id: I9359a68242af335ee6fbf8a0c781e4743e77bd5e
Signed-off-by: Sooyoung Ha <yoosah.ha@samsung.com>
*
*/
+#include <stdint.h>
#include "fileio.h"
gchar *get_simulator_path(void)
}
char *find_exec_path(char *line) {
- int loc;
- int find_loc = 0;
+ uintptr_t loc;
+ uintptr_t find_loc = 0;
char *ldpath = NULL;
char *start_p = NULL;
static char exec_path[512] = "";
int nfound = 0;
+ size_t len;
#if 0
// ld path -> factoryfs of bash_profile
return NULL;
}
- find_loc = (int)ldpath - (int)line;
+ find_loc = (uintptr_t)ldpath - (uintptr_t)line;
for (loc = 0; loc < find_loc;loc++) {
if (line[loc] == '#') {
}
}
- for (loc = 0; loc < strlen(ldpath);loc++) {
+ for (len = 0; len < strlen(ldpath);len++) {
- if (ldpath[loc] == '#') {
+ if (ldpath[len] == '#') {
return NULL;
}
- if (ldpath[loc] == '=') {
- start_p = &ldpath[loc];
+ if (ldpath[len] == '=') {
+ start_p = &ldpath[len];
nfound = 1;
break;
}
char *find_ld_path(char *line) {
- int loc;
+ uintptr_t loc;
char *ldpath = NULL;
- int find_loc = 0;
+ uintptr_t find_loc = 0;
+ size_t len;
ldpath = strstr(line, "LD_LIBRARY_PATH");
if (ldpath == NULL) {
return NULL;
}
- find_loc = (int)ldpath - (int)line;
+ find_loc = (uintptr_t)ldpath - (uintptr_t)line;
for (loc = 0; loc < find_loc;loc++) {
if (line[loc] == '#') {
}
}
- for (loc = 0; loc < strlen(ldpath);loc++) {
- if (ldpath[loc] == '#') {
+ for (len = 0; len < strlen(ldpath);len++) {
+ if (ldpath[len] == '#') {
return NULL;
}
- if (ldpath[loc] == '=') {
+ if (ldpath[len] == '=') {
break;
}
}
- return &ldpath[loc] + 1;
+ return &ldpath[len] + 1;
}
char *find_ld_path_by_bash_profile(char *target_path)
bzero(pUCS2Text, maxUCS2Length);
fprintf(stderr, "srcTextLen = %d\n", srcTextLen);
- fprintf(stderr, "temp buffer size = %d\n", maxUCS2Length * sizeof(unsigned short));
+ fprintf(stderr, "temp buffer size = %zu\n", (size_t)(maxUCS2Length * sizeof(unsigned short)));
fprintf(stderr, "max dest Length = %d\n", maxLength);
ucs2Length = MsgConvertUTF8toUCS2((unsigned char*)pUCS2Text, maxUCS2Length * sizeof(unsigned short), pSrcText, srcTextLen);
unsigned char * pdata = (unsigned char *) malloc(length);
- printf("size of gsm_network_nitz_info_t : %d\n",sizeof(reg));
+ printf("size of gsm_network_nitz_info_t : %zu\n",sizeof(reg));
if (!pdata)
return (-1);
GSM_SAT,
GSM_SAT_PROACTIVE_COMMAND_SEND,
1,
- (void *)command);
+ (void *)(&command));
}
printf("time: %s, weather: %s\n",
ussd->time, ussd->weather);
- printf("data length : %d\n",sizeof(*ussd));
- printf("time length : %d\n",sizeof(ussd->time));
- printf("weather length : %d\n",sizeof(ussd->weather));
+ printf("data length : %zu\n",sizeof(*ussd));
+ printf("time length : %zu\n",sizeof(ussd->time));
+ printf("weather length : %zu\n",sizeof(ussd->weather));
printf("size : %d\n", size);
#endif
aoc->acm, aoc->ccm, aoc->maxacm, aoc->ppu,
aoc->chartype);
- printf("data length : %d\n",sizeof(*aoc));
- printf("acm length : %d\n",sizeof(aoc->acm));
- printf("type length : %d\n",sizeof(aoc->ccm));
- printf("type length : %d\n",sizeof(aoc->maxacm));
- printf("type length : %d\n",sizeof(aoc->ppu));
- printf("type length : %d\n",sizeof(aoc->chartype));
+ printf("data length : %zu\n",sizeof(*aoc));
+ printf("acm length : %zu\n",sizeof(aoc->acm));
+ printf("type length : %zu\n",sizeof(aoc->ccm));
+ printf("type length : %zu\n",sizeof(aoc->maxacm));
+ printf("type length : %zu\n",sizeof(aoc->ppu));
+ printf("type length : %zu\n",sizeof(aoc->chartype));
printf("size : %d\n", size);
#endif
sms_data_len = start_pduIndex + total_data_length;
TRACE(MSGL_VGSM_INFO, "sca_length:%d, total_data_length: %d, cnt: %d\n", sca_length, total_data_length, cnt);
- TRACE(MSGL_VGSM_INFO, "(strlen(ATCMGS) + strlen(length) + strlen(token)): %d, sms_data_len:%d\n", (strlen(ATCMGS) + strlen(length) + strlen(token)), sms_data_len);
+ TRACE(MSGL_VGSM_INFO, "(strlen(ATCMGS) + strlen(length) + strlen(token)): %zu, sms_data_len:%d\n", (strlen(ATCMGS) + strlen(length) + strlen(token)), sms_data_len);
while(cnt < sms_data_len + 1)
{
return -1;
}
}
- TRACE(MSGL_VGSM_INFO, "atmsg length: %d\n", strlen(atmsg));
+ TRACE(MSGL_VGSM_INFO, "atmsg length: %zu\n", strlen(atmsg));
// set default value
frame.m_StartMagicCode = 0x7F;
if (bin_path)
g_free(bin_path);
- SIM_DEBUG("name, strlen : %s, %d", pb->name,strlen(pb->name));
+ SIM_DEBUG("name, strlen : %s, %zu", pb->name,strlen(pb->name));
db_sim_pb_get_check(pb);
if(isdata == 1)
/////////////////////
//090723
- SIM_DEBUG("name, strlen : %s, %d", pb->name,strlen(pb->name));
+ SIM_DEBUG("name, strlen : %s, %zu", pb->name,strlen(pb->name));
db_sim_pb_get_check(pb);
if(isdata != 1)
if (bin_path)
g_free(bin_path);
- SIM_DEBUG("puk %s len %d\n\n\n", puk, strlen(puk));
+ SIM_DEBUG("puk %s len %zu\n\n\n", puk, strlen(puk));
// open the database
err = sqlite3_open(dbname,&db);
call_forwarding_entry_t entry;
memset(entry.number, 0, sizeof(entry.number));
- log_msg(MSGL_VGSM_INFO,"class = %d, type = %d, number = %s(%d), reply time = %d, ss_mode = %d \n", atoi(*cols), atoi(*(cols+1)), *(cols+2), strlen(*(cols+2)), atoi(*(cols+3)), atoi(*(cols+4)));
+ log_msg(MSGL_VGSM_INFO,"class = %d, type = %d, number = %s(%zu), reply time = %d, ss_mode = %d \n", atoi(*cols), atoi(*(cols+1)), *(cols+2), strlen(*(cols+2)), atoi(*(cols+3)), atoi(*(cols+4)));
entry.tel_class = atoi(*cols);
entry.type = atoi(*(cols+1));
memcpy(&entry.number, *(cols+2), strlen(*(cols+2)));
sprintf(sndbuf, "%s%d,%s,%s,%s,%d,%d%s", CGDCONT, g_pdpcontext.cid, pdp_type, g_pdpcontext.apn, g_pdpcontext.pdp_addr, g_pdpcontext.d_comp, g_pdpcontext.h_comp, CRLF);
- log_msg(MSGL_VGSM_INFO,"packet:%s, length:%d\n", sndbuf, strlen(sndbuf));
+ log_msg(MSGL_VGSM_INFO,"packet:%s, length:%zu\n", sndbuf, strlen(sndbuf));
return oem_tx_gprs_IPConfigurationNotify(sndbuf, strlen(sndbuf));
}