projects
/
privoxy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0cb1af4
)
Fixed gcc43 conversion warnings.
author
Fabian Keil
<fk@fabiankeil.de>
Fri, 29 Dec 2006 17:38:57 +0000
(17:38 +0000)
committer
Fabian Keil
<fk@fabiankeil.de>
Fri, 29 Dec 2006 17:38:57 +0000
(17:38 +0000)
jcc.c
patch
|
blob
|
history
diff --git
a/jcc.c
b/jcc.c
index
e8f63a4
..
d65b6e1
100644
(file)
--- a/
jcc.c
+++ b/
jcc.c
@@
-1,4
+1,4
@@
-const char jcc_rcs[] = "$Id: jcc.c,v 1.11
3 2006/12/26 17:38:50
fabiankeil Exp $";
+const char jcc_rcs[] = "$Id: jcc.c,v 1.11
4 2006/12/27 18:52:02
fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/jcc.c,v $
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/jcc.c,v $
@@
-33,6
+33,10
@@
const char jcc_rcs[] = "$Id: jcc.c,v 1.113 2006/12/26 17:38:50 fabiankeil Exp $"
*
* Revisions :
* $Log: jcc.c,v $
*
* Revisions :
* $Log: jcc.c,v $
+ * Revision 1.114 2006/12/27 18:52:02 fabiankeil
+ * Fix -pedantic ISO C warning about converting
+ * from function pointer to object pointer.
+ *
* Revision 1.113 2006/12/26 17:38:50 fabiankeil
* Silence compiler warning I introduced with my last commit.
*
* Revision 1.113 2006/12/26 17:38:50 fabiankeil
* Silence compiler warning I introduced with my last commit.
*
@@
-1011,12
+1015,12
@@
static void chat(struct client_state *csp)
jb_socket maxfd;
int server_body;
int ms_iis5_hack = 0;
jb_socket maxfd;
int server_body;
int ms_iis5_hack = 0;
-
in
t byte_count = 0;
-
unsigned
int forwarded_connect_retries = 0;
-
unsigned
int max_forwarded_connect_retries = csp->config->forwarded_connect_retries;
+
size_
t byte_count = 0;
+ int forwarded_connect_retries = 0;
+ int max_forwarded_connect_retries = csp->config->forwarded_connect_retries;
const struct forward_spec * fwd;
struct http_request *http;
const struct forward_spec * fwd;
struct http_request *http;
-
in
t len; /* for buffer sizes */
+
size_
t len; /* for buffer sizes */
#ifdef FEATURE_KILL_POPUPS
int block_popups; /* bool, 1==will block popups */
int block_popups_now = 0; /* bool, 1==currently blocking popups */
#ifdef FEATURE_KILL_POPUPS
int block_popups; /* bool, 1==will block popups */
int block_popups_now = 0; /* bool, 1==currently blocking popups */
@@
-1692,7
+1696,7
@@
static void chat(struct client_state *csp)
*/
if (NULL == (p = (*content_filter)(csp)))
{
*/
if (NULL == (p = (*content_filter)(csp)))
{
- csp->content_length =
csp->iob->eod - csp->iob->cur
;
+ csp->content_length =
(size_t)(csp->iob->eod - csp->iob->cur)
;
}
hdr = sed(server_patterns_light, NULL, csp);
}
hdr = sed(server_patterns_light, NULL, csp);
@@
-1723,7
+1727,8
@@
static void chat(struct client_state *csp)
* This is NOT the body, so
* Let's pretend the server just sent us a blank line.
*/
* This is NOT the body, so
* Let's pretend the server just sent us a blank line.
*/
- len = sprintf(buf, "\r\n");
+ snprintf(buf, sizeof(buf), "\r\n");
+ len = strlen(buf);
/*
* Now, let the normal header parsing algorithm below do its
/*
* Now, let the normal header parsing algorithm below do its
@@
-1777,7
+1782,7
@@
static void chat(struct client_state *csp)
if (write_socket(csp->cfd, hdr, hdrlen)
|| ((flushed = flush_socket(csp->cfd, csp)) < 0)
if (write_socket(csp->cfd, hdr, hdrlen)
|| ((flushed = flush_socket(csp->cfd, csp)) < 0)
- || (write_socket(csp->cfd, buf,
(size_t)
len)))
+ || (write_socket(csp->cfd, buf, len)))
{
log_error(LOG_LEVEL_CONNECT, "Flush header and buffers to client failed: %E");
{
log_error(LOG_LEVEL_CONNECT, "Flush header and buffers to client failed: %E");
@@
-1785,7
+1790,7
@@
static void chat(struct client_state *csp)
return;
}
return;
}
- byte_count += hdrlen + flushed + len;
+ byte_count += hdrlen +
(size_t)
flushed + len;
freez(hdr);
content_filter = NULL;
server_body = 1;
freez(hdr);
content_filter = NULL;
server_body = 1;
@@
-1794,7
+1799,7
@@
static void chat(struct client_state *csp)
}
else
{
}
else
{
- if (write_socket(csp->cfd, buf,
(size_t)
len))
+ if (write_socket(csp->cfd, buf, len))
{
log_error(LOG_LEVEL_ERROR, "write to client failed: %E");
return;
{
log_error(LOG_LEVEL_ERROR, "write to client failed: %E");
return;
@@
-1936,7
+1941,7
@@
static void chat(struct client_state *csp)
*/
if (write_socket(csp->cfd, hdr, strlen(hdr))
*/
if (write_socket(csp->cfd, hdr, strlen(hdr))
- || ((len = flush_socket(csp->cfd, csp)) < 0))
+ || ((len =
(size_t)
flush_socket(csp->cfd, csp)) < 0))
{
log_error(LOG_LEVEL_CONNECT, "write header to client failed: %E");
{
log_error(LOG_LEVEL_CONNECT, "write header to client failed: %E");
@@
-2261,7
+2266,7
@@
int main(int argc, const char *argv[])
#endif /* FEATURE_PTHREAD */
#endif /* FEATURE_PTHREAD */
- random_seed = (int)time(NULL);
+ random_seed = (
unsigned
int)time(NULL);
#ifdef HAVE_RANDOM
srandom(random_seed);
#else
#ifdef HAVE_RANDOM
srandom(random_seed);
#else
@@
-2308,7
+2313,7
@@
int main(int argc, const char *argv[])
* We *are* in a windows console app.
* Print a verbose messages about FAQ's and such
*/
* We *are* in a windows console app.
* Print a verbose messages about FAQ's and such
*/
- printf(win32_blurb);
+ printf(
"%s",
win32_blurb);
# endif /* def _WIN_CONSOLE */
#endif /* def _WIN32 */
# endif /* def _WIN_CONSOLE */
#endif /* def _WIN32 */
@@
-2864,7
+2869,7
@@
static void listen_loop(void)
log_error(LOG_LEVEL_ERROR, "can't fork: %E");
log_error(LOG_LEVEL_ERROR, "can't fork: %E");
- s
printf(buf
, "Privoxy: can't fork: errno = %d", errno);
+ s
nprintf(buf , sizeof(buf)
, "Privoxy: can't fork: errno = %d", errno);
write_socket(csp->cfd, buf, strlen(buf));
close_socket(csp->cfd);
write_socket(csp->cfd, buf, strlen(buf));
close_socket(csp->cfd);