From 9440c6b2556d012a91c44eee00c56790819b722f Mon Sep 17 00:00:00 2001 From: tradke Date: Tue, 3 Apr 2001 11:52:30 +0000 Subject: Fixed most of the compiler warnings. git-svn-id: http://svn.cactuscode.org/arrangements/CactusConnect/HTTPD/trunk@120 1faa4e14-9dd3-4be0-9f0e-ffe519881164 --- src/Content.c | 61 +++++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 40 insertions(+), 21 deletions(-) (limited to 'src/Content.c') diff --git a/src/Content.c b/src/Content.c index 8745f26..3563a53 100644 --- a/src/Content.c +++ b/src/Content.c @@ -11,6 +11,8 @@ @version $Header$ @@*/ +#include "cctk.h" + #include #include #include @@ -19,7 +21,7 @@ #include #endif -#include "cctk.h" +#include "cctk_Version.h" #include "cctk_Parameter.h" #include "cctk_ActiveThorns.h" @@ -84,6 +86,8 @@ static int CookieTestPage(cGH *cctkGH, httpRequest *request, void *data); ********************* Other Routine Prototypes ********************* ********************************************************************/ +void HTTP_ContentWork(cGH *GH); +int HTTP_RegisterPages(void); int HTTPi_RegisterGroupsPages(void); int HTTPi_RegisterThornPages(void); int HTTPi_RegisterParameterPages(void); @@ -119,8 +123,11 @@ static const char *notauthorized_page = @endhistory @@*/ -void HTTP_ContentWork(CCTK_ARGUMENTS) +void HTTP_ContentWork(cGH *GH) { + /* avoid compiler warning about unused parameter */ + GH = GH; + #if 0 HTTP_SteerDispatch(); #endif @@ -202,19 +209,19 @@ int HTTP_ContentLink(const char *URL, int flags) { int retval; - struct httpLink *link; + struct httpLink *hlink; struct httpLink *last; struct httpLink *current; - link = (struct httpLink *)malloc(sizeof(struct httpLink)); + hlink = (struct httpLink *)malloc(sizeof(struct httpLink)); - if(link) + if(hlink) { - link->URL = Util_Strdup(URL); - link->name = Util_Strdup(name); - link->description = Util_Strdup(description); - link->flags = flags; - link->next = NULL; + hlink->URL = Util_Strdup(URL); + hlink->name = Util_Strdup(name); + hlink->description = Util_Strdup(description); + hlink->flags = flags; + hlink->next = NULL; /* Put on list */ if(ContentLinks) @@ -223,11 +230,11 @@ int HTTP_ContentLink(const char *URL, { last = current; } - last->next = link; + last->next = hlink; } else { - ContentLinks = link; + ContentLinks = hlink; } retval = 0; @@ -292,15 +299,17 @@ static int MainPage(cGH *cctkGH, httpRequest *request, void *data) DECLARE_CCTK_PARAMETERS int retval; - int filelen; char message[10098]; char title[4098]; char menu[4098]; char *dir; char *file; - struct httpLink *link; + struct httpLink *hlink; int seconds,minutes,hours,days,weeks,months,years,millenia; + /* avoid compiler warning about unused parameter */ + data = data; + /* Status message */ strcpy(message,"HTTP/1.0 200 OK\r\n"); @@ -393,11 +402,11 @@ static int MainPage(cGH *cctkGH, httpRequest *request, void *data) "

Available options:

\n" "
\n"); - for(link = ContentLinks; link; link=link->next) + for(hlink = ContentLinks; hlink; hlink=hlink->next) { sprintf(message, "%s
%s
%s \n", - message, link->URL, link->name, link->description); + message, hlink->URL, hlink->name, hlink->description); } @@ -484,7 +493,7 @@ static int MainPage(cGH *cctkGH, httpRequest *request, void *data) strcat(message,"
  • Parameter filename "); HTTP_Write(request, message, strlen(message)); - filelen = CCTK_ParameterFilename(4098,message); + CCTK_ParameterFilename(4098,message); Util_SplitFilename(&dir,&file,message); HTTP_Write(request, file, strlen(file)); @@ -496,7 +505,7 @@ static int MainPage(cGH *cctkGH, httpRequest *request, void *data) strcpy(message,"
  • Estimated time per iteration:
      "); sprintf(message,"%s
    • %f seconds
    ", - message,((float)CCTK_RunTime()/(float)cctkGH->cctk_iteration)); + message,CCTK_RunTime()/(double)cctkGH->cctk_iteration); HTTP_Write(request, message, strlen(message)); strcpy(message,"
  • Estimated time to completion:
      "); @@ -688,6 +697,9 @@ static int ShowStaticPage(cGH *cctkGH, httpRequest *request, void *data) char message[1024]; struct httpStaticPage *page; + /* avoid compiler warning about unused parameter */ + cctkGH = cctkGH; + if(data) { page = (struct httpStaticPage *)data; @@ -730,13 +742,15 @@ static int ControlPage(cGH *cctkGH, httpRequest *request, void *data) { DECLARE_CCTK_PARAMETERS - int retval; char message[4098]; int notauthorised; char thisuser[USER_LENGTH+1]; + /* avoid compiler warning about unused parameter */ + data = data; + notauthorised = HTTP_AuthenticateBasic(request, "user", thisuser, USER_LENGTH); if(!notauthorised) @@ -863,7 +877,7 @@ static int ControlPage(cGH *cctkGH, httpRequest *request, void *data) /* Write out the footer part. */ HTTP_ContentFooter(cctkGH, 0, 4098, message); - retval = HTTP_Write(request, message, strlen(message)); + HTTP_Write(request, message, strlen(message)); } else { @@ -1298,6 +1312,9 @@ static int AboutPage(cGH *cctkGH, httpRequest *request, void *data) int retval; char message[4098]; + /* avoid compiler warning about unused parameter */ + data = data; + /* Status message */ strcpy(message,"HTTP/1.0 200 OK\r\n"); @@ -1369,10 +1386,12 @@ static int CookieTestPage(cGH *cctkGH, httpRequest *request, void *data) { int retval; char message[4098]; - struct httpuFileList *list; const char *value; char *value2; + /* avoid compiler warning about unused parameter */ + data = data; + /* Status message */ strcpy(message,"HTTP/1.0 200 OK\r\n"); -- cgit v1.2.3