diff --git a/configure.ac b/configure.ac index 53fe4c5..a61d1fb 100644 --- a/configure.ac +++ b/configure.ac @@ -651,6 +651,7 @@ if test "x$enable_cookies" = "xno" ; then fi if test "x$enable_ipv6" = "xyes" ; then CFLAGS="$CFLAGS -DENABLE_IPV6" + CXXFLAGS="$CXXFLAGS -DENABLE_IPV6" fi if test "x$enable_efence" = "xyes" ; then LIBS="-lefence $LIBS" @@ -708,7 +709,7 @@ dnl ----------- dnl if eval "test x$GCC = xyes"; then - CXXFLAGS="$CXXFLAGS -Wall -W -Wno-unused-parameter -fno-rtti -fno-exceptions -pedantic -D_POSIX_C_SOURCE=200112L" + CXXFLAGS="$CXXFLAGS -Wall -W -Wno-unused-parameter -fno-rtti -fno-exceptions -pedantic -D_POSIX_C_SOURCE=200112L -std=c++23" fi dnl ---------------------------------- diff --git a/dlib/Makefile.am b/dlib/Makefile.am index 5f7d1bc..f03030d 100644 --- a/dlib/Makefile.am +++ b/dlib/Makefile.am @@ -5,4 +5,4 @@ noinst_LIBRARIES = libDlib.a libDlib_a_SOURCES = \ dlib.h \ - dlib.c + dlib.cc diff --git a/dlib/dlib.c b/dlib/dlib.cc similarity index 100% rename from dlib/dlib.c rename to dlib/dlib.cc diff --git a/dpi/datauri.c b/dpi/datauri.c index a7a9a4d..7743102 100644 --- a/dpi/datauri.c +++ b/dpi/datauri.c @@ -20,7 +20,7 @@ #include "../dpip/dpip.h" #include "dpiutil.h" -#include "../src/misc.h" +#include "../src/misc.hh" /* * Debugging macros diff --git a/src/IO/Makefile.am b/src/IO/Makefile.am index 21beffa..ff0277c 100644 --- a/src/IO/Makefile.am +++ b/src/IO/Makefile.am @@ -27,7 +27,7 @@ libDiof_a_SOURCES = \ mime.h \ about.c \ Url.h \ - http.c \ + http.cc \ tls.h \ tls.c \ $(TLS_OPENSSL) \ diff --git a/src/IO/Url.h b/src/IO/Url.h index 140a6ac..61b2655 100644 --- a/src/IO/Url.h +++ b/src/IO/Url.h @@ -2,7 +2,7 @@ #define __IO_URL_H__ #include "../chain.h" -#include "../url.h" +#include "../url.hh" #include "../../dlib/dlib.h" #ifdef __cplusplus diff --git a/src/IO/http.c b/src/IO/http.cc similarity index 88% rename from src/IO/http.c rename to src/IO/http.cc index 7c51756..930707f 100644 --- a/src/IO/http.c +++ b/src/IO/http.cc @@ -36,9 +36,9 @@ #include "../dns.h" #include "../web.hh" #include "../cookies.h" -#include "../auth.h" +#include "../auth.hh" #include "../prefs.h" -#include "../misc.h" +#include "../misc.hh" #include "../uicmd.hh" @@ -177,7 +177,7 @@ static int Http_sock_new(void) static int Http_fd_map_cmp(const void *v1, const void *v2) { int fd = VOIDP2INT(v2); - const FdMapEntry_t *e = v1; + const FdMapEntry_t *e = reinterpret_cast< const FdMapEntry_t * >( v1 ); return (fd != e->fd); } @@ -214,15 +214,15 @@ static void Http_fd_map_remove_entry(int fd) void a_Http_connect_done(int fd, bool_t success) { SocketData_t *sd; - FdMapEntry_t *fme = dList_find_custom(fd_map, INT2VOIDP(fd), - Http_fd_map_cmp); + FdMapEntry_t *fme = reinterpret_cast< FdMapEntry_t * >( dList_find_custom(fd_map, INT2VOIDP(fd), + Http_fd_map_cmp) ); - if (fme && (sd = a_Klist_get_data(ValidSocks, fme->skey))) { + if (fme && (sd = reinterpret_cast< SocketData_t * >( a_Klist_get_data(ValidSocks, fme->skey) ))) { ChainLink *info = sd->Info; bool_t valid_web = a_Web_valid(sd->web); if (success && valid_web) { - a_Chain_bfcb(OpSend, info, &sd->SockFD, "FD"); + a_Chain_bfcb(OpSend, info, &sd->SockFD, const_cast< void * >( static_cast< const void * >( "FD" ) )); Http_send_query(sd); } else { if (valid_web) @@ -230,7 +230,7 @@ void a_Http_connect_done(int fd, bool_t success) MSG("fd %d is done and failed\n", sd->SockFD); dClose(fd); Http_socket_free(VOIDP2INT(info->LocalKey)); /* free sd */ - a_Chain_bfcb(OpAbort, info, NULL, "Both"); + a_Chain_bfcb(OpAbort, info, NULL, const_cast< void * >( static_cast< const void * >( "Both" ) )); dFree(info); } } else { @@ -257,7 +257,7 @@ static void Http_connect_queued_sockets(Server_t *srv) (i < dList_length(srv->queue) && srv->active_conns < prefs.http_max_conns); i++) { - sd = dList_nth_data(srv->queue, i); + sd = reinterpret_cast< SocketData_t * >( dList_nth_data(srv->queue, i) ); if (sd->flags & HTTP_SOCKET_TO_BE_FREED) { dList_remove(srv->queue, sd); @@ -297,7 +297,7 @@ static void Http_socket_free(int SKey) { SocketData_t *S; - if ((S = a_Klist_get_data(ValidSocks, SKey))) { + if ((S = reinterpret_cast< SocketData_t * >( a_Klist_get_data(ValidSocks, SKey) ))) { a_Klist_remove(ValidSocks, SKey); if (S->flags & HTTP_SOCKET_IOWATCH_ACTIVE) { @@ -363,7 +363,7 @@ static Dstr *Http_make_content_type(const DilloUrl *url) if (URL_DATA(url)->len > 2) { /* boundary lines have "--" prepended. Skip that. */ const char *start = URL_DATA(url)->str + 2; - char *eol = strchr(start, '\r'); + const char *eol = strchr(start, '\r'); if (eol) dStr_append_l(dstr, start, eol - start); } else { @@ -504,14 +504,14 @@ static void Http_send_query(SocketData_t *S) static void Http_connect_tls(ChainLink *info) { int SKey = VOIDP2INT(info->LocalKey); - SocketData_t *S = a_Klist_get_data(ValidSocks, SKey); + SocketData_t *S = reinterpret_cast< SocketData_t * >( a_Klist_get_data(ValidSocks, SKey) ); if (S->flags & HTTP_SOCKET_USE_PROXY) { char *connect_str = Http_get_connect_str(S->url); DataBuf *dbuf = a_Chain_dbuf_new(connect_str, strlen(connect_str), 0); MSG_BW(S->web, 1, "Tunnel secure connection through proxy..."); - a_Chain_bfcb(OpSend, info, &S->SockFD, "FD"); + a_Chain_bfcb(OpSend, info, &S->SockFD, const_cast< void * >( static_cast< const void * >( "FD" ) )); S->https_proxy_reply = dStr_new(NULL); a_Chain_bcb(OpSend, info, dbuf, NULL); @@ -529,7 +529,7 @@ static void Http_connect_tls(ChainLink *info) static void Http_connect_socket_cb(int fd, void *data) { int SKey = VOIDP2INT(data); - SocketData_t *S = a_Klist_get_data(ValidSocks, SKey); + SocketData_t *S = reinterpret_cast< SocketData_t * >( a_Klist_get_data(ValidSocks, SKey) ); if (S) { int ret, connect_ret; @@ -567,9 +567,9 @@ static void Http_connect_socket_cb(int fd, void *data) static void Http_connect_socket(ChainLink *Info) { DilloHost *dh; - SocketData_t *S = a_Klist_get_data(ValidSocks, VOIDP2INT(Info->LocalKey)); + SocketData_t *S = reinterpret_cast< SocketData_t * >( a_Klist_get_data(ValidSocks, VOIDP2INT(Info->LocalKey)) ); - for (; (dh = dList_nth_data(S->addr_list, S->addr_list_idx)); + for (; (dh = reinterpret_cast< DilloHost * >( dList_nth_data(S->addr_list, S->addr_list_idx) )); S->addr_list_idx++) { #ifdef ENABLE_IPV6 struct sockaddr_in6 name; @@ -612,6 +612,7 @@ static void Http_connect_socket(ChainLink *Info) #ifdef ENABLE_IPV6 case AF_INET6: { + MSG("Doing 6 connect...\n"); char buf[128]; struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)&name; socket_len = sizeof(struct sockaddr_in6); @@ -623,6 +624,8 @@ static void Http_connect_socket(ChainLink *Info) MSG("Connecting to [%s]:%u\n", buf, S->connect_port); break; } +#else +#error Flenser requires modern IP protocol. Legacy IP protocol is deprecated. #endif } /* switch */ MSG_BW(S->web, 1, "Contacting host..."); @@ -643,7 +646,9 @@ static void Http_connect_socket(ChainLink *Info) S->flags |= HTTP_SOCKET_IOWATCH_ACTIVE; break; } else { - MSG("Http_connect_socket connect ERROR: %s\n", dStrerror(errno)); + MSG("Http_connect_socket connect ERROR: %s %d\n", dStrerror(errno), errno); + MSG("Http_connect_socket connect args: %d %p %d(fam) %d\n", S->SockFD, reinterpret_cast< void * >( &name ), + reinterpret_cast< struct sockaddr * >( &name )->sa_family, socket_len ); MSG("We will try another IP address.\n"); } } @@ -739,7 +744,7 @@ static void Http_dns_cb(int Status, Dlist *addr_list, void *data) SocketData_t *S; Server_t *srv; - S = a_Klist_get_data(ValidSocks, SKey); + S = reinterpret_cast< SocketData_t * >( a_Klist_get_data(ValidSocks, SKey) ); if (S) { const char *host = URL_HOST((S->flags & HTTP_SOCKET_USE_PROXY) ? HTTP_Proxy : S->url); @@ -763,7 +768,7 @@ static void Http_dns_cb(int Status, Dlist *addr_list, void *data) ChainLink *info = S->Info; Http_socket_free(SKey); - a_Chain_bfcb(OpAbort, info, NULL, "Both"); + a_Chain_bfcb(OpAbort, info, NULL, const_cast< void * >( static_cast< const void * >( "Both" ) )); dFree(info); } } @@ -782,9 +787,9 @@ static int Http_get(ChainLink *Info, void *Data1) char *hostname; const DilloUrl *url; - S = a_Klist_get_data(ValidSocks, VOIDP2INT(Info->LocalKey)); + S = reinterpret_cast< SocketData_t * >( a_Klist_get_data(ValidSocks, VOIDP2INT(Info->LocalKey)) ); /* Reference Web data */ - S->web = Data1; + S->web = reinterpret_cast< DilloWeb * >( Data1 ); /* Reference Info data */ S->Info = Info; @@ -819,17 +824,17 @@ static int Http_get(ChainLink *Info, void *Data1) * This is not built to accept arbitrary sockets. */ static bool_t Http_socket_reuse_compatible(SocketData_t *old, - SocketData_t *new) + SocketData_t *new_) { /* * If we are using TLS through a proxy, we need to ensure that old and new * are going through to the same host:port. */ - if (a_Web_valid(new->web) && + if (a_Web_valid(new_->web) && ((old->flags & HTTP_SOCKET_TLS) == 0 || (old->flags & HTTP_SOCKET_USE_PROXY) == 0 || - ((URL_PORT(old->url) == URL_PORT(new->url)) && - !dStrAsciiCasecmp(URL_HOST(old->url), URL_HOST(new->url))))) + ((URL_PORT(old->url) == URL_PORT(new_->url)) && + !dStrAsciiCasecmp(URL_HOST(old->url), URL_HOST(new_->url))))) return TRUE; return FALSE; } @@ -840,7 +845,7 @@ static bool_t Http_socket_reuse_compatible(SocketData_t *old, */ static void Http_socket_reuse(int SKey) { - SocketData_t *new_sd, *old_sd = a_Klist_get_data(ValidSocks, SKey); + SocketData_t *new_sd, *old_sd = reinterpret_cast< SocketData_t * >( a_Klist_get_data(ValidSocks, SKey) ); if (old_sd) { Server_t *srv = Http_server_get(old_sd->connected_to, @@ -849,7 +854,7 @@ static void Http_socket_reuse(int SKey) int i, n = dList_length(srv->queue); for (i = 0; i < n; i++) { - new_sd = dList_nth_data(srv->queue, i); + new_sd = reinterpret_cast< SocketData_t * >( dList_nth_data(srv->queue, i) ); if (!(new_sd->flags & HTTP_SOCKET_TO_BE_FREED) && Http_socket_reuse_compatible(old_sd, new_sd)) { @@ -886,7 +891,7 @@ void a_Http_ccc(int Op, int Branch, int Dir, ChainLink *Info, SocketData_t *sd; DataBuf *dbuf; - dReturn_if_fail( a_Chain_check("a_Http_ccc", Op, Branch, Dir, Info) ); + dReturn_if_fail( a_Chain_check(const_cast< char * >( "a_Http_ccc" ), Op, Branch, Dir, Info) ); if (Branch == 1) { if (Dir == BCK) { @@ -922,10 +927,10 @@ void a_Http_ccc(int Op, int Branch, int Dir, ChainLink *Info, switch (Op) { case OpAbort: _MSG("ABORT 1F\n"); - if ((sd = a_Klist_get_data(ValidSocks, SKey))) + if ((sd = reinterpret_cast< SocketData_t * >( a_Klist_get_data(ValidSocks, SKey) ))) MSG_BW(sd->web, 1, "Can't get %s", URL_STR(sd->url)); Http_socket_free(SKey); - a_Chain_fcb(OpAbort, Info, NULL, "Both"); + a_Chain_fcb(OpAbort, Info, NULL, const_cast< void * >( static_cast< const void * >( "Both" ) )); dFree(Info); break; default: @@ -935,13 +940,13 @@ void a_Http_ccc(int Op, int Branch, int Dir, ChainLink *Info, } } else if (Branch == 2) { if (Dir == FWD) { - sd = a_Klist_get_data(ValidSocks, SKey); + sd = reinterpret_cast< SocketData_t * >( a_Klist_get_data(ValidSocks, SKey) ); assert(sd); /* Receiving from server */ switch (Op) { case OpSend: if (sd->https_proxy_reply) { - dbuf = Data1; + dbuf = reinterpret_cast< DataBuf * >( Data1 ); dStr_append(sd->https_proxy_reply, dbuf->Buf); if (strstr(sd->https_proxy_reply->str, "\r\n\r\n")) { if (sd->https_proxy_reply->len >= 12 && @@ -959,13 +964,13 @@ void a_Http_ccc(int Op, int Branch, int Dir, ChainLink *Info, MSG("CONNECT through proxy failed. Server sent:\n%s\n", sd->https_proxy_reply->str); Http_socket_free(SKey); - a_Chain_bfcb(OpAbort, Info, NULL, "Both"); + a_Chain_bfcb(OpAbort, Info, NULL, const_cast< void * >( static_cast< const void * >( "Both" ) )); dFree(Info); } } } else { /* Data1 = dbuf */ - a_Chain_fcb(OpSend, Info, Data1, "send_page_2eof"); + a_Chain_fcb(OpSend, Info, Data1, const_cast< void * >( static_cast< const void * >( "send_page_2eof" ) )); } break; case OpEnd: @@ -975,7 +980,7 @@ void a_Http_ccc(int Op, int Branch, int Dir, ChainLink *Info, sd->https_proxy_reply->len ? sd->https_proxy_reply->str : "(nothing)"); Http_socket_free(SKey); - a_Chain_bfcb(OpAbort, Info, NULL, "Both"); + a_Chain_bfcb(OpAbort, Info, NULL, const_cast< void * >( static_cast< const void * >( "Both" ) )); } else { Http_socket_free(SKey); a_Chain_fcb(OpEnd, Info, NULL, NULL); @@ -990,7 +995,7 @@ void a_Http_ccc(int Op, int Branch, int Dir, ChainLink *Info, "(nothing)"); } Http_socket_free(SKey); - a_Chain_fcb(OpAbort, Info, NULL, "Both"); + a_Chain_fcb(OpAbort, Info, NULL, const_cast< void * >( static_cast< const void * >( "Both" ) )); dFree(Info); break; default: @@ -1005,13 +1010,13 @@ void a_Http_ccc(int Op, int Branch, int Dir, ChainLink *Info, break; case OpSend: if (Data2) { - if (!strcmp(Data2, "FD")) { + if (!strcmp(reinterpret_cast< const char * >( Data2 ), "FD")) { int fd = *(int*)Data1; - FdMapEntry_t *fme = dList_find_custom(fd_map, INT2VOIDP(fd), - Http_fd_map_cmp); + FdMapEntry_t *fme = reinterpret_cast< FdMapEntry_t * >( dList_find_custom(fd_map, INT2VOIDP(fd), + Http_fd_map_cmp) ); Info->LocalKey = INT2VOIDP(fme->skey); a_Chain_bcb(OpSend, Info, Data1, Data2); - } else if (!strcmp(Data2, "reply_complete")) { + } else if (!strcmp(reinterpret_cast< const char * >( Data2 ), "reply_complete")) { a_Chain_bfcb(OpEnd, Info, NULL, NULL); Http_socket_reuse(SKey); dFree(Info); @@ -1043,7 +1048,7 @@ static void Http_socket_enqueue(Server_t *srv, SocketData_t* sock) int i, n = dList_length(srv->queue); for (i = 0; i < n; i++) { - SocketData_t *curr = dList_nth_data(srv->queue, i); + SocketData_t *curr = reinterpret_cast< SocketData_t * >( dList_nth_data(srv->queue, i) ); if (a_Web_valid(curr->web) && (curr->web->flags & WEB_Image)) { dList_insert_pos(srv->queue, sock, i); @@ -1082,7 +1087,7 @@ static void Http_server_remove(Server_t *srv) { SocketData_t *sd; - while ((sd = dList_nth_data(srv->queue, 0))) { + while ((sd = reinterpret_cast< SocketData_t * >( dList_nth_data(srv->queue, 0) ))) { dList_remove_fast(srv->queue, sd); dFree(sd); } @@ -1099,7 +1104,7 @@ static void Http_servers_remove_all(void) while (dList_length(servers) > 0) { srv = (Server_t*) dList_nth_data(servers, 0); - while ((sd = dList_nth_data(srv->queue, 0))) { + while ((sd = reinterpret_cast< SocketData_t * >( dList_nth_data(srv->queue, 0) ))) { dList_remove(srv->queue, sd); dFree(sd); } diff --git a/src/IO/mime.h b/src/IO/mime.h index 3bb24da..d54a947 100644 --- a/src/IO/mime.h +++ b/src/IO/mime.h @@ -19,7 +19,7 @@ extern "C" { #endif /* __cplusplus */ -#include "../cache.h" +#include "../cache.hh" typedef void* (*Viewer_t) (const char*, void*, CA_Callback_t*, void**); diff --git a/src/IO/tls.h b/src/IO/tls.h index 7f43282..a3dda0c 100644 --- a/src/IO/tls.h +++ b/src/IO/tls.h @@ -25,7 +25,7 @@ extern "C" { #endif -#include "../url.h" +#include "../url.hh" #define TLS_CONNECT_NEVER -1 #define TLS_CONNECT_NOT_YET 0 diff --git a/src/IO/tls_mbedtls.h b/src/IO/tls_mbedtls.h index 07a0737..46f1717 100644 --- a/src/IO/tls_mbedtls.h +++ b/src/IO/tls_mbedtls.h @@ -19,7 +19,7 @@ extern "C" { #endif -#include "../url.h" +#include "../url.hh" const char *a_Tls_mbedtls_version(char *buf, int n); void a_Tls_mbedtls_init(void); diff --git a/src/IO/tls_openssl.h b/src/IO/tls_openssl.h index 5b442cb..3bdeea6 100644 --- a/src/IO/tls_openssl.h +++ b/src/IO/tls_openssl.h @@ -29,7 +29,7 @@ extern "C" { #endif -#include "../url.h" +#include "../url.hh" const char *a_Tls_openssl_version(char *buf, int n); void a_Tls_openssl_init(void); diff --git a/src/Makefile.am b/src/Makefile.am index b4bb978..72bad4c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -43,8 +43,8 @@ dillo_SOURCES = \ actions.h \ hsts.c \ hsts.h \ - auth.c \ - auth.h \ + auth.cc \ + auth.hh \ md5.c \ md5.h \ digest.c \ @@ -52,8 +52,8 @@ dillo_SOURCES = \ colors.c \ colors.h \ binaryconst.h \ - misc.c \ - misc.h \ + misc.cc \ + misc.hh \ history.h \ history.c \ prefs.c \ @@ -64,8 +64,8 @@ dillo_SOURCES = \ keys.hh \ msg.h \ list.h \ - url.c \ - url.h \ + url.cc \ + url.hh \ bitvec.c \ bitvec.h \ klist.c \ @@ -84,8 +84,8 @@ dillo_SOURCES = \ web.hh \ nav.c \ nav.h \ - cache.c \ - cache.h \ + cache.cc \ + cache.hh \ decode.c \ decode.h \ dicache.c \ diff --git a/src/auth.c b/src/auth.cc similarity index 95% rename from src/auth.c rename to src/auth.cc index 3b4ae66..3305d9e 100644 --- a/src/auth.c +++ b/src/auth.cc @@ -18,9 +18,9 @@ #include /* iscntrl, isascii */ -#include "auth.h" +#include "auth.hh" #include "msg.h" -#include "misc.h" +#include "misc.hh" #include "dialog.hh" #include "digest.h" #include "../dlib/dlib.h" @@ -359,7 +359,7 @@ static AuthHost_t *Auth_host_by_url(const DilloUrl *url) AuthHost_t *host; int i; - for (i = 0; (host = dList_nth_data(auth_hosts, i)); i++) + for (i = 0; (host = reinterpret_cast< AuthHost_t * >( dList_nth_data(auth_hosts, i) )); i++) if (((dStrAsciiCasecmp(URL_SCHEME(url), host->scheme) == 0) && (dStrAsciiCasecmp(URL_AUTHORITY(url), host->authority) == 0))) return host; @@ -376,7 +376,7 @@ static AuthRealm_t *Auth_realm_by_name(const AuthHost_t *host, AuthRealm_t *realm; int i; - for (i = 0; (realm = dList_nth_data(host->realms, i)); i++) + for (i = 0; (realm = reinterpret_cast< AuthRealm_t * >( dList_nth_data(host->realms, i) )); i++) if (strcmp(realm->name, name) == 0) return realm; @@ -394,10 +394,10 @@ static AuthRealm_t *Auth_realm_by_path(const AuthHost_t *host, int match_length = 0; realm_best = NULL; - for (i = 0; (realm = dList_nth_data(host->realms, i)); i++) { + for (i = 0; (realm = reinterpret_cast< AuthRealm_t * >( dList_nth_data(host->realms, i) )); i++) { char *realm_path; - for (j = 0; (realm_path = dList_nth_data(realm->paths, j)); j++) { + for (j = 0; (realm_path = reinterpret_cast< char * >( dList_nth_data(realm->paths, j) )); j++) { int realm_path_length = strlen(realm_path); if (Auth_path_is_inside(path, realm_path, realm_path_length) && !(realm_best && match_length >= realm_path_length)) { @@ -433,7 +433,7 @@ static int Auth_realm_includes_path(const AuthRealm_t *realm, const char *path) int i; char *realm_path; - for (i = 0; (realm_path = dList_nth_data(realm->paths, i)); i++) + for (i = 0; (realm_path = reinterpret_cast< char * >( dList_nth_data(realm->paths, i) )); i++) if (Auth_path_is_inside(path, realm_path, strlen(realm_path))) return 1; @@ -453,7 +453,7 @@ static void Auth_realm_add_path(AuthRealm_t *realm, const char *path) n_path[--len] = 0; /* delete existing paths that are inside the new one */ - for (i = 0; (realm_path = dList_nth_data(realm->paths, i)); i++) { + for (i = 0; (realm_path = reinterpret_cast< char * >( dList_nth_data(realm->paths, i) )); i++) { if (Auth_path_is_inside(realm_path, path, len)) { dList_remove_fast(realm->paths, realm_path); dFree(realm_path); @@ -635,7 +635,7 @@ static int Auth_do_auth_dialog(const AuthParse_t *auth_parse, data->url = a_Url_dup(url); ret = a_Dialog_user_password(title, msg, Auth_do_auth_dialog_cb, data); dFree(title); dFree(msg); - a_Url_free((void *)data->url); + a_Url_free(const_cast< DilloUrl * >( data->url )); dFree(data); return ret; } @@ -673,11 +673,11 @@ int a_Auth_do_auth(Dlist *challenges, const DilloUrl *url) int i; char *chal; - for (i = 0; (chal = dList_nth_data(challenges, i)); ++i) + for (i = 0; (chal = reinterpret_cast< char * >( dList_nth_data(challenges, i) )); ++i) if (!dStrnAsciiCasecmp(chal, "Digest ", 7)) if (Auth_do_auth(chal, DIGEST, url)) return 1; - for (i = 0; (chal = dList_nth_data(challenges, i)); ++i) + for (i = 0; (chal = reinterpret_cast< char * >( dList_nth_data(challenges, i) )); ++i) if (!dStrnAsciiCasecmp(chal, "Basic ", 6)) if (Auth_do_auth(chal, BASIC, url)) return 1; diff --git a/src/auth.h b/src/auth.hh similarity index 82% rename from src/auth.h rename to src/auth.hh index 03863e5..97a2968 100644 --- a/src/auth.h +++ b/src/auth.hh @@ -1,11 +1,6 @@ -#ifndef __AUTH_H__ -#define __AUTH_H__ +#pragma once -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include "url.h" +#include "url.hh" enum AuthParseHTTPAuthType_t { TYPENOTSET, BASIC, DIGEST }; enum AuthParseDigestAlgorithm_t { ALGORITHMNOTSET, MD5, MD5SESS }; @@ -33,8 +28,3 @@ char *a_Auth_get_auth_str(const DilloUrl *url, const char *request_uri); int a_Auth_do_auth(Dlist *auth_string, const DilloUrl *url); void a_Auth_init(void); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* !__AUTH_H__ */ diff --git a/src/bw.h b/src/bw.h index 83d9508..6980ee4 100644 --- a/src/bw.h +++ b/src/bw.h @@ -13,7 +13,7 @@ #ifndef __BW_H__ #define __BW_H__ -#include "url.h" /* for DilloUrl */ +#include "url.hh" /* for DilloUrl */ /* * Flag Defines for a_Bw_stop_clients() diff --git a/src/cache.c b/src/cache.cc similarity index 95% rename from src/cache.c rename to src/cache.cc index fd3a683..bf60bd7 100644 --- a/src/cache.c +++ b/src/cache.cc @@ -29,10 +29,10 @@ #include "nav.h" #include "cookies.h" #include "hsts.h" -#include "misc.h" +#include "misc.hh" #include "capi.h" #include "decode.h" -#include "auth.h" +#include "auth.hh" #include "domain.h" #include "timeout.hh" #include "uicmd.hh" @@ -96,7 +96,7 @@ static void Cache_entry_inject(const DilloUrl *Url, Dstr *data_ds); */ static int Cache_entry_cmp(const void *v1, const void *v2) { - const CacheEntry_t *d1 = v1, *d2 = v2; + const CacheEntry_t *d1 = reinterpret_cast< const CacheEntry_t * >( v1 ), *d2 = reinterpret_cast< const CacheEntry_t * >( v2 ); return a_Url_cmp(d1->Url, d2->Url); } @@ -106,8 +106,8 @@ static int Cache_entry_cmp(const void *v1, const void *v2) */ static int Cache_entry_by_url_cmp(const void *v1, const void *v2) { - const DilloUrl *u1 = ((CacheEntry_t*)v1)->Url; - const DilloUrl *u2 = v2; + const DilloUrl *u1 = reinterpret_cast< const CacheEntry_t * >( v1 )->Url; + const DilloUrl *u2 = reinterpret_cast< const DilloUrl * >( v2 ); return a_Url_cmp(u1, u2); } @@ -179,7 +179,7 @@ static void Cache_client_dequeue(CacheClient_t *Client) { if (Client) { dList_remove(ClientQueue, Client); - a_Web_free(Client->Web); + a_Web_free(reinterpret_cast< DilloWeb * >( Client->Web )); dFree(Client); } } @@ -217,7 +217,7 @@ static void Cache_entry_init(CacheEntry_t *NewEntry, const DilloUrl *Url) */ static CacheEntry_t *Cache_entry_search(const DilloUrl *Url) { - return dList_find_sorted(CachedURLs, Url, Cache_entry_by_url_cmp); + return reinterpret_cast< CacheEntry_t * >( dList_find_sorted(CachedURLs, Url, Cache_entry_by_url_cmp) ); } /** @@ -333,7 +333,7 @@ static void Cache_entry_remove(CacheEntry_t *entry, DilloUrl *url) return; /* remove all clients for this entry */ - for (i = 0; (Client = dList_nth_data(ClientQueue, i)); ++i) { + for (i = 0; (Client = reinterpret_cast< CacheClient_t * >( dList_nth_data(ClientQueue, i) )); ++i) { if (Client->Url == entry->Url) { a_Cache_stop_client(Client->Key); --i; @@ -377,7 +377,7 @@ int a_Cache_open_url(void *web, CA_Callback_t Call, void *CbData) { int ClientKey; CacheEntry_t *entry; - DilloWeb *Web = web; + DilloWeb *Web = reinterpret_cast< DilloWeb * >( web ); DilloUrl *Url = Web->url; if (URL_FLAGS(Url) & URL_E2EQuery) { @@ -766,9 +766,9 @@ static void Cache_parse_header(CacheEntry_t *entry) if ((Cookies = Cache_parse_multiple_fields(header, "Set-Cookie"))) { CacheClient_t *client; - for (i = 0; (client = dList_nth_data(ClientQueue, i)); ++i) { + for (i = 0; (client = reinterpret_cast< CacheClient_t * >( dList_nth_data(ClientQueue, i) )); ++i) { if (client->Url == entry->Url) { - DilloWeb *web = client->Web; + DilloWeb *web = reinterpret_cast< DilloWeb * >( client->Web ); if (!web->requester || a_Url_same_organization(entry->Url, web->requester)) { @@ -975,7 +975,7 @@ bool_t a_Cache_process_dbuf(int Op, const char *buf, size_t buf_size, int i; CacheClient_t *Client; - for (i = 0; (Client = dList_nth_data(ClientQueue, i)); ++i) { + for (i = 0; (Client = reinterpret_cast< CacheClient_t * >( dList_nth_data(ClientQueue, i) )); ++i) { if (Client->Url == entry->Url) { DilloWeb *web = (DilloWeb *)Client->Web; @@ -1106,7 +1106,7 @@ int a_Cache_download_enabled(const DilloUrl *url) */ static void Cache_null_client(int Op, CacheClient_t *Client) { - DilloWeb *Web = Client->Web; + DilloWeb *Web = reinterpret_cast< DilloWeb * >( Client->Web ); /* make the stop button insensitive when done */ if (Op == CA_Close) { @@ -1145,7 +1145,7 @@ static void Cache_savelink_cb(void *vdata) static void Cache_provide_redirection_blocked_page(CacheEntry_t *entry, CacheClient_t *client) { - DilloWeb *clientWeb = client->Web; + DilloWeb *clientWeb = reinterpret_cast< DilloWeb * >( client->Web ); a_Web_dispatch_by_type("text/html", clientWeb, &client->Callback, &client->CbData); @@ -1155,7 +1155,7 @@ static void Cache_provide_redirection_blocked_page(CacheEntry_t *entry, " to Location), "\">", URL_STR(entry->Location), " based on your domainrc " "settings.", NULL); - client->BufSize = strlen(client->Buf); + client->BufSize = strlen(reinterpret_cast< const char * >( client->Buf )); (client->Callback)(CA_Send, client); dFree(client->Buf); } @@ -1207,9 +1207,9 @@ static CacheEntry_t *Cache_process_queue(CacheEntry_t *entry) } Busy = TRUE; - for (i = 0; (Client = dList_nth_data(ClientQueue, i)); ++i) { + for (i = 0; (Client = reinterpret_cast< CacheClient_t * >( dList_nth_data(ClientQueue, i) )); ++i) { if (Client->Url == entry->Url) { - ClientWeb = Client->Web; /* It was a (void*) */ + ClientWeb = reinterpret_cast< DilloWeb * >( Client->Web ); /* It was a (void*) */ Client_bw = ClientWeb->bw; /* 'bw' in a local var */ if (ClientWeb->flags & WEB_RootUrl) { @@ -1401,9 +1401,9 @@ CacheClient_t *a_Cache_client_get_if_unique(int Key) int i, n = 0; CacheClient_t *Client, *iClient; - if ((Client = dList_find_custom(ClientQueue, INT2VOIDP(Key), - Cache_client_by_key_cmp))) { - for (i = 0; (iClient = dList_nth_data(ClientQueue, i)); ++i) { + if ((Client = reinterpret_cast< CacheClient_t * >( dList_find_custom(ClientQueue, INT2VOIDP(Key), + Cache_client_by_key_cmp) ))) { + for (i = 0; (iClient = reinterpret_cast< CacheClient_t * >( dList_nth_data(ClientQueue, i) )); ++i) { if (iClient->Url == Client->Url) { ++n; } @@ -1423,8 +1423,8 @@ void a_Cache_stop_client(int Key) DICacheEntry *DicEntry; /* The client can be in both queues at the same time */ - if ((Client = dList_find_custom(ClientQueue, INT2VOIDP(Key), - Cache_client_by_key_cmp))) { + if ((Client = reinterpret_cast< CacheClient_t * >( dList_find_custom(ClientQueue, INT2VOIDP(Key), + Cache_client_by_key_cmp) ))) { /* Dicache */ if ((DicEntry = a_Dicache_get_entry(Client->Url, Client->Version))) a_Dicache_unref(Client->Url, Client->Version); @@ -1451,13 +1451,13 @@ void a_Cache_freeall(void) void *data; /* free the client queue */ - while ((Client = dList_nth_data(ClientQueue, 0))) + while ((Client = reinterpret_cast< CacheClient_t * >( dList_nth_data(ClientQueue, 0) ))) Cache_client_dequeue(Client); /* Remove every cache entry */ while ((data = dList_nth_data(CachedURLs, 0))) { dList_remove_fast(CachedURLs, data); - Cache_entry_free(data); + Cache_entry_free(reinterpret_cast< CacheEntry_t * >( data )); } /* Remove the cache list */ dList_free(CachedURLs); diff --git a/src/cache.h b/src/cache.hh similarity index 99% rename from src/cache.h rename to src/cache.hh index 5074eb0..7148ae0 100644 --- a/src/cache.h +++ b/src/cache.hh @@ -7,7 +7,7 @@ extern "C" { #include "chain.h" -#include "url.h" +#include "url.hh" /* * Cache Op codes diff --git a/src/capi.h b/src/capi.h index a50c751..86711a9 100644 --- a/src/capi.h +++ b/src/capi.h @@ -6,7 +6,7 @@ extern "C" { #endif /* __cplusplus */ -#include "cache.h" +#include "cache.hh" #include "web.hh" /* diff --git a/src/chain.h b/src/chain.h index 0e938bd..0236e2e 100644 --- a/src/chain.h +++ b/src/chain.h @@ -1,6 +1,10 @@ #ifndef __CHAIN_H__ #define __CHAIN_H__ +#ifdef __cplusplus +extern "C" { +#endif + /* * Concomitant control chain (CCC) * Theory and code by Jorge Arellano Cid @@ -73,4 +77,7 @@ int a_Chain_check(char *FuncStr, int Op, int Branch, int Dir, DataBuf *a_Chain_dbuf_new(void *buf, int size, int code); +#ifdef __cplusplus +} +#endif #endif /* __CHAIN_H__ */ diff --git a/src/dgif.h b/src/dgif.h index b02e611..06b5e73 100644 --- a/src/dgif.h +++ b/src/dgif.h @@ -5,7 +5,7 @@ extern "C" { #endif /* __cplusplus */ -#include "url.h" +#include "url.hh" #include "image.hh" diff --git a/src/dialog.cc b/src/dialog.cc index 6228f6e..109f142 100644 --- a/src/dialog.cc +++ b/src/dialog.cc @@ -16,6 +16,8 @@ #include // for rint() #include +#include + #include #include @@ -33,7 +35,7 @@ #include "msg.h" #include "dialog.hh" -#include "misc.h" +#include "misc.hh" #include "prefs.h" #include "dlib/dlib.h" @@ -224,6 +226,8 @@ const char *a_Dialog_input(const char *title, const char *msg) input_str = dStrdup(c_inp->value()); prefs.search_url_idx = ch->value(); } + //delete b; + assert(window->contains(b)); window.reset(); return (input_answer == 1) ? input_str : NULL; diff --git a/src/dicache.h b/src/dicache.h index c940452..bcc03c2 100644 --- a/src/dicache.h +++ b/src/dicache.h @@ -8,7 +8,7 @@ extern "C" { #include "bitvec.h" #include "image.hh" -#include "cache.h" +#include "cache.hh" /** Symbolic name to request the last version of an image */ #define DIC_Last -1 diff --git a/src/digest.h b/src/digest.h index 1afe4b5..4a991b6 100644 --- a/src/digest.h +++ b/src/digest.h @@ -1,9 +1,13 @@ #ifndef __DIGEST_H__ #define __DIGEST_H__ -#include "auth.h" +#include "auth.hh" #include "../dlib/dlib.h" +#ifdef __cplusplus +extern "C" { +#endif + char *a_Digest_create_cnonce(void); int a_Digest_compute_digest(AuthRealm_t *realm, @@ -13,4 +17,7 @@ char *a_Digest_authorization_hdr(AuthRealm_t *realm, const DilloUrl *url, const char *uri); +#ifdef __cplusplus +} +#endif #endif /* !__DIGEST_H__ */ diff --git a/src/dillo.cc b/src/dillo.cc index 14117bf..33f9839 100644 --- a/src/dillo.cc +++ b/src/dillo.cc @@ -45,7 +45,7 @@ #include "prefsparser.hh" #include "keys.hh" #include "bw.h" -#include "misc.h" +#include "misc.hh" #include "history.h" #include "version.hh" @@ -60,7 +60,7 @@ #include "actions.h" #include "hsts.h" #include "domain.h" -#include "auth.h" +#include "auth.hh" #include "styleengine.hh" #include "dw/fltkcore.hh" diff --git a/src/djpeg.h b/src/djpeg.h index a22d105..ea879be 100644 --- a/src/djpeg.h +++ b/src/djpeg.h @@ -5,7 +5,7 @@ extern "C" { #endif /* __cplusplus */ -#include "url.h" +#include "url.hh" #include "image.hh" diff --git a/src/domain.h b/src/domain.h index f8e1fdf..3655592 100644 --- a/src/domain.h +++ b/src/domain.h @@ -6,7 +6,7 @@ extern "C" { #endif #include -#include "url.h" +#include "url.hh" void a_Domain_parse(FILE *fp); void a_Domain_freeall(void); diff --git a/src/dpng.h b/src/dpng.h index 0b8a2dd..960f511 100644 --- a/src/dpng.h +++ b/src/dpng.h @@ -5,9 +5,9 @@ extern "C" { #endif /* __cplusplus */ -#include "url.h" +#include "url.hh" #include "image.hh" -#include "cache.h" +#include "cache.hh" void *a_Png_new(DilloImage *Image, DilloUrl *url, int version); diff --git a/src/dsvg.h b/src/dsvg.h index 2fe7c1a..4c886c4 100644 --- a/src/dsvg.h +++ b/src/dsvg.h @@ -5,7 +5,7 @@ extern "C" { #endif /* __cplusplus */ -#include "url.h" +#include "url.hh" #include "image.hh" diff --git a/src/dwebp.h b/src/dwebp.h index 3c89299..be77fc2 100644 --- a/src/dwebp.h +++ b/src/dwebp.h @@ -5,7 +5,7 @@ extern "C" { #endif /* __cplusplus */ -#include "url.h" +#include "url.hh" #include "image.hh" diff --git a/src/form.cc b/src/form.cc index 185def9..ce79bbc 100644 --- a/src/form.cc +++ b/src/form.cc @@ -21,7 +21,7 @@ #include "dw/textblock.hh" #include "dlib/dlib.h" -#include "misc.h" +#include "misc.hh" #include "msg.h" #include "prefs.h" #include "uicmd.hh" diff --git a/src/form.hh b/src/form.hh index 7cb2bcc..13ca79f 100644 --- a/src/form.hh +++ b/src/form.hh @@ -1,7 +1,7 @@ #ifndef __FORM_HH__ #define __FORM_HH__ -#include "url.h" +#include "url.hh" /* * Typedefs diff --git a/src/gif.c b/src/gif.c index d7d60cf..3bc531e 100644 --- a/src/gif.c +++ b/src/gif.c @@ -67,7 +67,7 @@ #include "msg.h" #include "image.hh" -#include "cache.h" +#include "cache.hh" #include "dicache.h" #define INTERLACE 0x40 diff --git a/src/history.h b/src/history.h index fbff563..0134034 100644 --- a/src/history.h +++ b/src/history.h @@ -2,7 +2,7 @@ #ifndef __DILLO_HISTORY_H__ #define __DILLO_HISTORY_H__ -#include "url.h" +#include "url.hh" #ifdef __cplusplus diff --git a/src/hsts.h b/src/hsts.h index 3b2cf4b..b340915 100644 --- a/src/hsts.h +++ b/src/hsts.h @@ -2,7 +2,7 @@ #define __HSTS_H__ #include "d_size.h" -#include "url.h" +#include "url.hh" #ifdef __cplusplus extern "C" { diff --git a/src/html.cc b/src/html.cc index ab71ff6..8f11f4d 100644 --- a/src/html.cc +++ b/src/html.cc @@ -30,7 +30,7 @@ #include "html_charrefs.h" #include "utf8.hh" -#include "misc.h" +#include "misc.hh" #include "uicmd.hh" #include "history.h" #include "menu.hh" diff --git a/src/html.hh b/src/html.hh index 67aeee6..5746130 100644 --- a/src/html.hh +++ b/src/html.hh @@ -13,7 +13,7 @@ #ifndef __HTML_HH__ #define __HTML_HH__ -#include "url.h" // for DilloUrl +#include "url.hh" // for DilloUrl #ifdef __cplusplus extern "C" { diff --git a/src/html_common.hh b/src/html_common.hh index edf4007..393268a 100644 --- a/src/html_common.hh +++ b/src/html_common.hh @@ -14,7 +14,7 @@ #ifndef __HTML_COMMON_HH__ #define __HTML_COMMON_HH__ -#include "url.h" +#include "url.hh" #include "bw.h" #include "lout/misc.hh" diff --git a/src/image.hh b/src/image.hh index 280fcef..3ba1b0d 100644 --- a/src/image.hh +++ b/src/image.hh @@ -24,7 +24,7 @@ extern "C" { #include "bitvec.h" -#include "url.h" +#include "url.hh" /* * Defines diff --git a/src/jpeg.c b/src/jpeg.c index d6fac82..3625f2f 100644 --- a/src/jpeg.c +++ b/src/jpeg.c @@ -33,7 +33,7 @@ #endif #include "image.hh" -#include "cache.h" +#include "cache.hh" #include "dicache.h" #include "capi.h" /* get cache entry status */ #include "msg.h" diff --git a/src/misc.c b/src/misc.cc similarity index 99% rename from src/misc.c rename to src/misc.cc index c4151f5..3dc1806 100644 --- a/src/misc.c +++ b/src/misc.cc @@ -17,7 +17,7 @@ #include "utf8.hh" #include "msg.h" -#include "misc.h" +#include "misc.hh" /** * Escape characters as %XX sequences. @@ -25,7 +25,7 @@ */ char *a_Misc_escape_chars(const char *str, const char *esc_set) { - static const char *const hex = "0123456789ABCDEF"; + static const char hex[] = "0123456789ABCDEF"; char *p = NULL; Dstr *dstr; int i; @@ -136,7 +136,7 @@ typedef enum { int a_Misc_get_content_type_from_data(void *Data, size_t Size, const char **PT) { size_t i, non_ascci, non_ascci_text, bin_chars; - char *p = Data; + char *p = reinterpret_cast< char * >( Data ); int st = 1; /* default to "doubt' */ DetectedContentType Type = DT_OCTET_STREAM; /* default to binary */ diff --git a/src/misc.h b/src/misc.hh similarity index 81% rename from src/misc.h rename to src/misc.hh index b1d6ee2..18981ee 100644 --- a/src/misc.h +++ b/src/misc.hh @@ -1,13 +1,7 @@ -#ifndef __DILLO_MISC_H__ -#define __DILLO_MISC_H__ +#pragma once #include /* for size_t */ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - #define d_isascii(c) (((c) & ~0x7f) == 0) char *a_Misc_escape_chars(const char *str, const char *esc_set); @@ -21,10 +15,3 @@ int a_Misc_parse_geometry(char *geom, int *x, int *y, int *w, int *h); int a_Misc_parse_search_url(char *source, char **label, char **urlstr); char *a_Misc_encode_base64(const char *in); Dstr *a_Misc_file2dstr(const char *filename); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __DILLO_MISC_H__ */ - diff --git a/src/plain.cc b/src/plain.cc index b8478b5..fe75791 100644 --- a/src/plain.cc +++ b/src/plain.cc @@ -17,10 +17,10 @@ #include "msg.h" #include "prefs.h" -#include "cache.h" +#include "cache.hh" #include "bw.h" #include "web.hh" -#include "misc.h" +#include "misc.hh" #include "styleengine.hh" #include "uicmd.hh" diff --git a/src/png.c b/src/png.c index d1faaf6..8db0e5f 100644 --- a/src/png.c +++ b/src/png.c @@ -27,7 +27,7 @@ #include "msg.h" #include "image.hh" -#include "cache.h" +#include "cache.hh" #include "dicache.h" enum prog_state { diff --git a/src/prefs.h b/src/prefs.h index daa3070..d496fb5 100644 --- a/src/prefs.h +++ b/src/prefs.h @@ -13,7 +13,7 @@ #ifndef __PREFS_H__ #define __PREFS_H__ -#include "url.h" +#include "url.hh" #ifdef __cplusplus extern "C" { diff --git a/src/prefsparser.cc b/src/prefsparser.cc index a7c7e5c..d910211 100644 --- a/src/prefsparser.cc +++ b/src/prefsparser.cc @@ -22,7 +22,7 @@ #include #include "prefs.h" -#include "misc.h" +#include "misc.hh" #include "msg.h" #include "colors.h" diff --git a/src/styleengine.cc b/src/styleengine.cc index 0087b0b..be40c6a 100644 --- a/src/styleengine.cc +++ b/src/styleengine.cc @@ -13,7 +13,7 @@ #include "../dlib/dlib.h" #include "msg.h" #include "prefs.h" -#include "misc.h" +#include "misc.hh" #include "html_common.hh" #include "styleengine.hh" #include "web.hh" diff --git a/src/svg.c b/src/svg.c index 9fffbe3..1c112ed 100644 --- a/src/svg.c +++ b/src/svg.c @@ -17,7 +17,7 @@ #include "msg.h" #include "image.hh" -#include "cache.h" +#include "cache.hh" #include "dicache.h" #define NANOSVG_ALL_COLOR_KEYWORDS diff --git a/src/uicmd.cc b/src/uicmd.cc index 533de28..d9affad 100644 --- a/src/uicmd.cc +++ b/src/uicmd.cc @@ -45,7 +45,7 @@ #include "history.h" #include "msg.h" #include "prefs.h" -#include "misc.h" +#include "misc.hh" #include "dlib/dlib.h" #include "dw/fltkviewport.hh" diff --git a/src/url.c b/src/url.cc similarity index 99% rename from src/url.c rename to src/url.cc index 210785a..5b89c95 100644 --- a/src/url.c +++ b/src/url.cc @@ -46,9 +46,9 @@ #include #include -#include "url.h" +#include "url.hh" #include "hsts.h" -#include "misc.h" +#include "misc.hh" #include "msg.h" static const char *HEX = "0123456789ABCDEF"; @@ -97,7 +97,7 @@ char *a_Url_str(const DilloUrl *u) */ const char *a_Url_hostname(const DilloUrl *u) { - char *p; + const char *p; /* Internal url handling IS transparent to the caller */ DilloUrl *url = (DilloUrl *) u; @@ -603,7 +603,7 @@ char *a_Url_decode_hex_str(const char *str) } *dest++ = 0; - new_str = dRealloc(new_str, sizeof(char) * (dest - new_str)); + new_str = reinterpret_cast< char * >( dRealloc(new_str, sizeof(char) * (dest - new_str)) ); return new_str; } diff --git a/src/url.h b/src/url.hh similarity index 100% rename from src/url.h rename to src/url.hh diff --git a/src/web.hh b/src/web.hh index eba00f5..9f746e5 100644 --- a/src/web.hh +++ b/src/web.hh @@ -1,9 +1,8 @@ -#ifndef __WEB_H__ -#define __WEB_H__ +#pragma once #include /* for FILE */ #include "bw.h" /* for BrowserWindow */ -#include "cache.h" /* for CA_Callback_t */ +#include "cache.hh" /* for CA_Callback_t */ #include "image.hh" /* for DilloImage */ #ifdef __cplusplus @@ -47,4 +46,3 @@ int a_Web_dispatch_by_type (const char *Type, DilloWeb *web, #ifdef __cplusplus } #endif /* __cplusplus */ -#endif /* __WEB_H__ */ diff --git a/src/webp.c b/src/webp.c index ba0adac..d8bdcae 100644 --- a/src/webp.c +++ b/src/webp.c @@ -19,7 +19,7 @@ #include "msg.h" #include "image.hh" -#include "cache.h" +#include "cache.hh" #include "dicache.h" enum prog_state {