ipc.c and ipcsockets.c, swallow type conversion warnings

This commit is contained in:
rlar 2011-06-25 17:36:17 +00:00
parent d59845b427
commit 828e04c9fd
3 changed files with 23 additions and 19 deletions

View File

@ -1,6 +1,11 @@
2011-06-25 Robert Larice
* src/xspice/ipc/ipc.c ,
* src/xspice/ipc/ipcsockets.c :
ipc.c and ipcsockets.c, swallow type conversion warnings
2011-06-25 Robert Larice
* src/frontend/plotting/graf.c :
graf.c, swallow type conversion warning
graf.c, swallow type conversion warnings
2011-06-25 Holger Vogt
* main.c, defines.h: improved shutdown message for Windows GUI

View File

@ -394,7 +394,7 @@ ipc_flush (void)
/* write the records to the .log file */
if ((end_of_record_index [i] - last) !=
write (batch_fd, &out_buffer[last], end_of_record_index [i] - last)) {
write (batch_fd, &out_buffer[last], (size_t) (end_of_record_index [i] - last))) {
/* fprintf (stderr,"ERROR: IPC: Error writing to batch output file\n"); */
perror ("IPC");
return IPC_STATUS_ERROR;
@ -813,11 +813,10 @@ stuff_binary_v1 (
if (n > 1) {
trick.float_val[1] = (float)d2;
}
for (i = 0, j = pos; i < n*sizeof(float); j++, i++)
for (i = 0, j = pos; i < n * (int) sizeof(float); j++, i++)
buf[j] = trick.ch[i];
i = sizeof(float)*n + pos;
buf[0] = 'A' + i - 1;
return i;
buf[0] = (char) ('A' + j - 1);
return j;
}
/*---------------------------------------------------------------------------*/
@ -847,7 +846,7 @@ ipc_send_double (
/* If talking to Mentor tools, must force upper case for Mspice 7.0 */
strtoupper(fmt_buffer);
len = stuff_binary_v1 (value, 0.0, 1, fmt_buffer, strlen(fmt_buffer));
len = stuff_binary_v1 (value, 0.0, 1, fmt_buffer, (int) strlen(fmt_buffer));
break;
case IPC_PROTOCOL_V2:
break;
@ -883,7 +882,7 @@ ipc_send_complex (
strtoupper(fmt_buffer);
len = stuff_binary_v1 (value.real, value.imag, 2, fmt_buffer,
strlen(fmt_buffer));
(int) strlen(fmt_buffer));
break;
case IPC_PROTOCOL_V2:
break;
@ -922,7 +921,7 @@ ipc_send_event (
float fvalue;
/* Report error if size of data is too big for IPC channel block size */
if((len + strlen(print_val) + 100) >= OUT_BUFFER_SIZE) {
if((len + (int) strlen(print_val) + 100) >= OUT_BUFFER_SIZE) {
printf("ERROR - Size of event-driven data too large for IPC channel\n");
return IPC_STATUS_ERROR;
}
@ -970,8 +969,8 @@ ipc_send_event (
/* Put the print value in */
strcpy(buff_ptr, print_val);
buff_ptr += strlen(print_val);
buff_len += strlen(print_val);
buff_ptr += strlen(print_val);
buff_len += (int) strlen(print_val);
/* Send the data to the IPC channel */
return ipc_send_line_binary(buff, buff_len);

View File

@ -169,7 +169,7 @@ ipc_transport_initialize_server (
{
struct sockaddr_in server; /* Server specifications for socket*/
unsigned int server_length; /* Size of server structure */
unsigned int port_num; /* Port number converted from server_name */
int port_num; /* Port number converted from server_name */
NG_IGNORE(mode);
NG_IGNORE(protocol);
@ -296,7 +296,7 @@ bytes_to_integer (
it in the variable u. */
index = 0;
while (index < sizeof(u)) {
while (index < (int) sizeof(u)) {
buff[index] = str[index+start];
index++;
}
@ -412,7 +412,7 @@ read_sock (
/* buffer[count] = 'x'; */
/* count++; */
/* } */
count = read (stream, buffer, length);
count = (int) read (stream, buffer, (size_t) length);
if (wait == IPC_NO_WAIT) {
fcntl (stream, F_SETFL, flags); /* Revert to blocking read */
}
@ -425,7 +425,7 @@ read_sock (
buf2 = &buffer[totalcount];
length = length - count;
while (length > 0) {
count = read (stream, buf2, length);
count = (int) read (stream, buf2, (size_t) length);
if (count <= 0) /* EOF or read error */
break;
totalcount = totalcount + count;
@ -558,7 +558,7 @@ ipc_transport_get_line (
"ERROR: IPC: Did not find beginning of message header (%c)\n",
str[0]);
return IPC_STATUS_ERROR;
} else if ((message_length = bytes_to_integer (str, 1)) == -1) {
} else if ((message_length = (int) bytes_to_integer (str, 1)) == -1) {
/* fprintf (stderr, "WARNING: IPC: Reached eof on socket\n"); */
return handle_socket_eof ();
} else if (message_length == 0) {
@ -660,19 +660,19 @@ ipc_transport_send_line (
/* Write message body header with length: */
hdr_buff[0] = BOL_CHAR;
u = htonl (len);
u = htonl ((u_long) len);
char_ptr = (char *) &u;
for(i = 0; i < 4; i++)
hdr_buff[i+1] = char_ptr[i];
count = write (msg_stream, hdr_buff, 5);
count = (int) write (msg_stream, hdr_buff, 5);
if (count != 5) {
fprintf (stderr, "ERROR: IPC: (%d) send line error 1\n", count);
return IPC_STATUS_ERROR;
}
/* Write message body: */
count = write (msg_stream, str, len);
count = (int) write (msg_stream, str, (size_t) len);
if (count != len) {
fprintf (stderr, "ERROR: IPC: (%d) send line error 2\n", count);
return IPC_STATUS_ERROR;