Permalink
Browse files

Merge pull request #7 from fuzxxl/master

Fix warnings in libwww2
  • Loading branch information...
2 parents c89d60c + 39b7642 commit d2b739512011ceeb13c9775f068002825d643726 @alandipert committed Mar 9, 2013
View
@@ -52,8 +52,8 @@
* mosaic-x@ncsa.uiuc.edu. *
****************************************************************************/
-#ifndef HTML_H
-#define HTML_H
+#ifndef HTMLW_HTML_H
+#define HTMLW_HTML_H
#ifdef MOTIF
#include <Xm/Xm.h>
@@ -634,5 +634,5 @@ typedef struct _HTMLRec *HTMLWidget;
extern WidgetClass htmlWidgetClass;
-#endif /* HTML_H */
+#endif /* HTMLW_HTML_H */
View
@@ -1,3 +1,4 @@
+int compact_string(char *main_string, char *ellipsis_string, int num_chars, int mode, int eLength);
char *getFileName(char *file_src);
char *strcasechr(char *src, char srch);
char *strrcasechr(char *src, char srch);
View
@@ -734,13 +734,13 @@ PRIVATE char *compose_auth_string ARGS2(HTAAScheme, scheme,
if (!(result = (char*)malloc(300)))
outofmem(__FILE__, "compose_auth_string");
-
+
nonce = HTAssocList_lookup(setup->scheme_specifics[scheme], "nonce");
- if (!nonce)
+ if (!nonce)
return "";
-
+
opaque = HTAssocList_lookup(setup->scheme_specifics[scheme], "opaque");
- if (!opaque)
+ if (!opaque)
return "";
if (!(A1 = (unsigned char*)malloc(strlen(realm->username) +
@@ -753,22 +753,22 @@ PRIVATE char *compose_auth_string ARGS2(HTAAScheme, scheme,
/* make A1 */
*A1 = (unsigned char)0;
- strcat(A1, realm->username);
- strcat(A1, ":");
- strcat(A1, realm->realmname);
- strcat(A1, ":");
- strcat(A1, realm->password);
- strcat(A1, "\0");
+ strcat((char*)A1, realm->username);
+ strcat((char*)A1, ":");
+ strcat((char*)A1, realm->realmname);
+ strcat((char*)A1, ":");
+ strcat((char*)A1, realm->password);
+ strcat((char*)A1, "\0");
/* make A2 */
*A2 = (unsigned char)0;
if (do_post)
- strcat(A2, "POST");
+ strcat((char*)A2, "POST");
else
- strcat(A2, "GET");
- strcat(A2, ":");
- strcat(A2, current_docname);
- strcat(A2, "\0");
+ strcat((char*)A2, "GET");
+ strcat((char*)A2, ":");
+ strcat((char*)A2, current_docname);
+ strcat((char*)A2, "\0");
if (!(md5_cleartext = (unsigned char*)malloc(100 + 1)))
outofmem(__FILE__, "compose_auth_string");
@@ -783,22 +783,22 @@ PRIVATE char *compose_auth_string ARGS2(HTAAScheme, scheme,
if (!(digest2 = (unsigned char*)malloc(16)))
outofmem(__FILE__, "compose_auth_string");
- MD5Mem(A1, strlen(A1), digest1);
- MD5Mem(A2, strlen(A2), digest2);
+ MD5Mem(A1, strlen((char*)A1), digest1);
+ MD5Mem(A2, strlen((char*)A2), digest2);
MD5Convert_to_Hex(digest1, hex1);
MD5Convert_to_Hex(digest2, hex2);
/* make md5_cleartext */
*md5_cleartext = (unsigned char)0;
- strcat(md5_cleartext, hex1);
- strcat(md5_cleartext, ":");
- strcat(md5_cleartext, nonce);
- strcat(md5_cleartext, ":");
- strcat(md5_cleartext, hex2);
+ strcat((char*)md5_cleartext, (char*)hex1);
+ strcat((char*)md5_cleartext, ":");
+ strcat((char*)md5_cleartext, (char*)nonce);
+ strcat((char*)md5_cleartext, ":");
+ strcat((char*)md5_cleartext, (char*)hex2);
- MD5Mem(md5_cleartext, strlen(md5_cleartext), digest1);
+ MD5Mem(md5_cleartext, strlen((char*)md5_cleartext), digest1);
MD5Convert_to_Hex(digest1, md5_ciphertext);
*result = (char)0;
@@ -811,12 +811,12 @@ PRIVATE char *compose_auth_string ARGS2(HTAAScheme, scheme,
strcat(result, "\", uri=\"");
strcat(result, current_docname);
strcat(result, "\", response=\"");
- strcat(result, md5_ciphertext);
+ strcat(result, (char*)md5_ciphertext);
strcat(result, "\", opaque=\"");
strcat(result, opaque);
strcat(result, "\"");
- /* since all we need from here on out is the result,
+ /* since all we need from here on out is the result,
get rid of all the rest */
free(A1);
free(A2);
View
@@ -47,6 +47,7 @@
#include "tcp.h" /* NETREAD() etc. */
#include "HTAAUtil.h" /* Implemented here */
#include "HTAssoc.h" /* Assoc list */
+#include "HTTCP.h"
#ifndef DISABLE_TRACE
extern int www2Trace;
View
@@ -41,7 +41,11 @@
#include "HText.h" /* See bugs above */
#include "HTAlert.h"
+#include "../src/mosaic.h"
+#include "../src/gui.h"
+#include "../src/mo-www.h"
#include "../src/proxy.h"
+#include "../src/proxy-dialogs.h"
#ifndef DISABLE_TRACE
extern int www2Trace;
View
@@ -15,10 +15,8 @@
#include "tcp.h" /* for TOUPPER */
#include <ctype.h> /* for toupper - should be in tcp.h */
-extern void mo_gui_notify_progress (char *);
-extern int mo_gui_check_icon (int);
-extern void mo_gui_clear_icon (void);
-extern void mo_gui_update_meter(int,char *);
+#include "../src/mosaic.h"
+#include "../src/gui.h"
PUBLIC void HTAlert ARGS1(WWW_CONST char *, Msg)
{
View
@@ -28,14 +28,15 @@ extern char * HTPromptPassword PARAMS((WWW_CONST char * Msg));
** The input is a list of parameters for printf.
*/
extern void HTAlert PARAMS((WWW_CONST char * Msg));
-
+extern void HTDoneWithIcon NOPARAMS;
/* Display a progress message for information (and diagnostics) only
**
** On entry,
** The input is a list of parameters for printf.
*/
extern void HTProgress PARAMS((WWW_CONST char * Msg));
+extern void HTMeter PARAMS((WWW_CONST int, WWW_CONST char *));
extern int HTCheckActiveIcon PARAMS((int twirl));
extern void HTClearActiveIcon NOPARAMS;
View
@@ -96,9 +96,9 @@ PUBLIC HTChildAnchor * HTAnchor_findChild
#endif
return NULL;
}
- if (kids = parent->children) { /* parent has children : search them */
+ if ((kids = parent->children)) { /* parent has children : search them */
if (tag && *tag) { /* TBL */
- while (child = HTList_nextObject (kids)) {
+ while ((child = HTList_nextObject (kids))) {
if (equivalent(child->tag, tag)) { /* Case sensitive 920226 */
#ifndef DISABLE_TRACE
if (www2Trace) fprintf (stderr,
@@ -115,7 +115,7 @@ PUBLIC HTChildAnchor * HTAnchor_findChild
child = HTChildAnchor_new ();
#ifndef DISABLE_TRACE
if (www2Trace) fprintf(stderr, "new Anchor %p named `%s' is child of %p\n",
- (void*)child, (int)tag ? tag : (WWW_CONST char *)"" , (void*)parent); /* int for apollo */
+ (void*)child, tag == NULL ? tag : (WWW_CONST char *)"" , (void*)parent); /* int for apollo */
#endif
HTList_addObject (parent->children, child);
child->parent = parent;
@@ -201,7 +201,7 @@ HTAnchor * HTAnchor_findAddress
/* Search list for anchor */
grownups = adults;
- while (foundAnchor = HTList_nextObject (grownups)) {
+ while ((foundAnchor = HTList_nextObject (grownups))) {
if (equivalent(foundAnchor->address, address)) {
#ifndef DISABLE_TRACE
if (www2Trace) fprintf(stderr, "Anchor %p with address `%s' already exists.\n",
@@ -21,6 +21,9 @@
#include "../libnut/system.h"
+#include "../src/mosaic.h"
+#include "../src/mo-www.h"
+
#ifndef DISABLE_TRACE
extern int www2Trace;
#endif
View
@@ -43,10 +43,13 @@
#include <string.h>
#include <stdlib.h>
#include <time.h>
+#include <unistd.h>
+
#include "HTFTP.h" /* Implemented here */
#include "../libnut/str-tools.h"
#define LINE_LENGTH 1024
+#include "HTAlert.h"
#include "HTParse.h"
#include "HTUtils.h"
#include "tcp.h"
@@ -57,6 +60,10 @@
#include "HTSort.h"
#include "HText.h"
+#include "../src/mosaic.h"
+#include "../src/gui.h"
+#include "../src/gui-dialogs.h"
+
#ifndef MAXHOSTNAMELEN
#define MAXHOSTNAMELEN 64 /* Arbitrary limit */
#endif
@@ -125,6 +132,8 @@ extern int ftpFilenameLength;
extern int ftpEllipsisLength;
extern int ftpEllipsisMode;
+void CLOSE_CONTROL(int);
+
/*SWP -- 9.27.95 -- Directory parsing*/
#define NEW_PARSE
#ifdef NEW_PARSE
@@ -1042,7 +1051,7 @@ PRIVATE int get_listen_socket()
sin->sin_addr.s_addr = INADDR_ANY; /* Any peer address */
{
int status;
- int address_length = sizeof(soc_address);
+ socklen_t address_length = sizeof(soc_address);
#ifdef SOCKS
status = Rgetsockname(control,
#else
@@ -1878,7 +1887,7 @@ ARGS4 (
{
struct sockaddr_in soc_address;
- int soc_addrlen = sizeof(soc_address);
+ socklen_t soc_addrlen = sizeof(soc_address);
#ifdef SOCKS
status = Raccept(master_socket,
#else
@@ -2271,7 +2280,7 @@ PUBLIC int HTFTPSend ARGS1 ( char *, name ) {
extern int twirl_increment;
int next_twirl = twirl_increment, intr = 0;
struct sockaddr_in soc_address;
- int soc_addrlen = sizeof (soc_address);
+ socklen_t soc_addrlen = sizeof (soc_address);
struct stat sbuf;
HTProgress ("FTP send in progress.");
@@ -2501,7 +2510,7 @@ PUBLIC int HTFTPSend ARGS1 ( char *, name ) {
} /* End of HTFTPSend */
-CLOSE_CONTROL(s)
+void CLOSE_CONTROL(s)
int s;
{
NETCLOSE(s);
View
@@ -9,6 +9,7 @@
*/
#include "../config.h"
#include <string.h>
+#include <unistd.h>
#include "HTFWriter.h"
@@ -19,6 +20,12 @@
#include "tcp.h"
#include "HTCompressed.h"
+#include "../libhtmlw/HTML.h"
+
+#include "../src/mosaic.h"
+#include "../src/gui-dialogs.h"
+#include "../src/img.h"
+
extern char *currentURL;
int imageViewInternal=0;
@@ -245,7 +252,7 @@ PRIVATE void HTFWriter_free ARGS1(HTStream *, me)
buf=(char *)calloc((strlen(currentURL)+strlen(me->fnam)+5),sizeof(char));
sprintf(buf,"%s\n%s",me->fnam,currentURL);
- ImageResolve(NULL,buf,0);
+ ImageResolve(NULL,buf,0,NULL,NULL);
free(buf);
View
@@ -23,6 +23,8 @@
#include <stdio.h>
#include <sys/param.h>
+#include <unistd.h>
+
#include "HText.h"
#include "HTUtils.h"
@@ -36,7 +38,9 @@
#include "HTFWriter.h"
#include "HTInit.h"
#include "HTSort.h"
+
#include "../libnut/system.h"
+#include "../libnut/str-tools.h"
typedef struct _HTSuffix {
char * suffix;
@@ -729,7 +733,7 @@ PUBLIC BOOL HTEditable ARGS1 (WWW_CONST char *,filename)
#ifdef NO_GROUPS
return NO; /* Safe answer till we find the correct algorithm */
#else
- int groups[NGROUPS];
+ gid_t groups[NGROUPS];
uid_t myUid;
int ngroups; /* The number of groups */
struct stat fileStatus;
@@ -1165,8 +1169,8 @@ PUBLIC int HTLoadFile ARGS4 (
if(strcmp(dataptr,".") == 0) continue;
/* If its .. *and* the current directory is / dont show anything, otherwise
-/* print out a nice Parent Directory entry.
-/* */
+ * print out a nice Parent Directory entry.
+ * */
if(strcmp(dataptr,"..") == 0)
{
@@ -1227,8 +1231,8 @@ PUBLIC int HTLoadFile ARGS4 (
}
else
{
- sprintf(buffer,"%s (%d bytes)",
- dataptr, statbuf.st_size);
+ sprintf(buffer,"%s (%ld bytes)",
+ dataptr, (long)statbuf.st_size);
format = HTFileFormat(dataptr, &pencoding,
WWW_SOURCE, &cmpr);
View
@@ -2,6 +2,8 @@
** =============================
**
*/
+#include <unistd.h>
+
#include "../config.h"
/* Connection: Keep-Alive support -bjs */
#include "HTMIME.h"
@@ -24,6 +26,7 @@ PUBLIC float HTMaxLength = 1e10; /* No effective limit */
#include "SGML.h"
#include "HTML.h"
#include "HTMLGen.h"
+#include "HTTCP.h"
/* From gui-documents.c. */
extern int loading_inlined_images;
View
@@ -47,7 +47,7 @@
#include "HTUtils.h" /* Coding convention macros */
#include "tcp.h"
-
+#include "HTAlert.h"
#include "HTParse.h"
#include "HTFormat.h"
#include "HTFile.h"
Oops, something went wrong. Retry.

0 comments on commit d2b7395

Please sign in to comment.