Skip to content

Commit

Permalink
Fix some compiler warnings / cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
pp3345 committed Apr 21, 2014
1 parent 7dc511c commit 735ba56
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 11 deletions.
3 changes: 1 addition & 2 deletions ConfigurationParser/PancakeConfigurationParser.c
Expand Up @@ -531,7 +531,6 @@ static int __config_read(config_t *config, FILE *stream, const char *filename,
yyscan_t scanner; yyscan_t scanner;
struct scan_context scan_ctx; struct scan_context scan_ctx;
struct parse_context parse_ctx; struct parse_context parse_ctx;
YY_BUFFER_STATE buffer = NULL;
int r; int r;


/* Reinitialize the config */ /* Reinitialize the config */
Expand Down Expand Up @@ -563,7 +562,7 @@ static int __config_read(config_t *config, FILE *stream, const char *filename,
if(stream) if(stream)
PancakeConfigurationParser_yyrestart(stream, scanner); PancakeConfigurationParser_yyrestart(stream, scanner);
else /* read from string */ else /* read from string */
buffer = PancakeConfigurationParser_yy_scan_string(str, scanner); PancakeConfigurationParser_yy_scan_string(str, scanner);


PancakeConfigurationParser_yyset_lineno(1, scanner); PancakeConfigurationParser_yyset_lineno(1, scanner);
r = PancakeConfigurationParser_yyparse(scanner, &parse_ctx, &scan_ctx); r = PancakeConfigurationParser_yyparse(scanner, &parse_ctx, &scan_ctx);
Expand Down
6 changes: 4 additions & 2 deletions HTTP/PancakeHTTP.c
@@ -1,9 +1,11 @@
#include "PancakeHTTP.h" #include "PancakeHTTP.h"
#include "PancakeConfiguration.h"
#include "PancakeLogger.h"


#ifdef PANCAKE_HTTP #ifdef PANCAKE_HTTP


#include "PancakeConfiguration.h"
#include "PancakeLogger.h"
#include "PancakeDateTime.h"

#ifdef PANCAKE_HTTP_REWRITE #ifdef PANCAKE_HTTP_REWRITE
#include "HTTPRewrite/PancakeHTTPRewrite.h" #include "HTTPRewrite/PancakeHTTPRewrite.h"
#endif #endif
Expand Down
1 change: 1 addition & 0 deletions HTTP/PancakeHTTP.h
Expand Up @@ -157,6 +157,7 @@ PANCAKE_API inline UByte PancakeHTTPServeContent(PancakeSocket *sock, UByte igno
PANCAKE_API void PancakeHTTPException(PancakeSocket *sock, UInt16 code); PANCAKE_API void PancakeHTTPException(PancakeSocket *sock, UInt16 code);
PANCAKE_API inline void PancakeHTTPOnRemoteHangup(PancakeSocket *sock); PANCAKE_API inline void PancakeHTTPOnRemoteHangup(PancakeSocket *sock);
PANCAKE_API inline void PancakeHTTPFullWriteBuffer(PancakeSocket *sock); PANCAKE_API inline void PancakeHTTPFullWriteBuffer(PancakeSocket *sock);
PANCAKE_API void PancakeHTTPOutput(PancakeSocket *sock, String *output);
PANCAKE_API void PancakeHTTPOutputChunk(PancakeSocket *sock, String *output); PANCAKE_API void PancakeHTTPOutputChunk(PancakeSocket *sock, String *output);
PANCAKE_API void PancakeHTTPSendChunk(PancakeSocket *sock, String *chunk); PANCAKE_API void PancakeHTTPSendChunk(PancakeSocket *sock, String *chunk);
PANCAKE_API inline void PancakeHTTPSendLastChunk(PancakeSocket *sock); PANCAKE_API inline void PancakeHTTPSendLastChunk(PancakeSocket *sock);
Expand Down
2 changes: 1 addition & 1 deletion HTTPRewrite/PancakeHTTPRewrite.c
Expand Up @@ -121,7 +121,7 @@ static UByte PancakeHTTPRewriteCompile(UByte step, config_setting_t *setting, Pa
// Lookup variable or function // Lookup variable or function
if(setting->op == CONFIG_OP_CALL) { if(setting->op == CONFIG_OP_CALL) {
HASH_FIND(hh, callbacks, setting->name, length, callback); HASH_FIND(hh, callbacks, setting->name, length, callback);
PancakeAssert(var != NULL); PancakeAssert(callback != NULL);
} else { } else {
HASH_FIND(hh, variables, setting->name, length, var); HASH_FIND(hh, variables, setting->name, length, var);
PancakeAssert(var != NULL); PancakeAssert(var != NULL);
Expand Down
4 changes: 3 additions & 1 deletion HTTPStatic/PancakeHTTPStatic.c
@@ -1,9 +1,11 @@


#include "PancakeHTTPStatic.h" #include "PancakeHTTPStatic.h"
#include "MIME/PancakeMIME.h"


#if defined(PANCAKE_HTTP_STATIC) && defined(PANCAKE_HTTP) #if defined(PANCAKE_HTTP_STATIC) && defined(PANCAKE_HTTP)


#include "MIME/PancakeMIME.h"
#include "PancakeDateTime.h"

/* Forward declarations */ /* Forward declarations */
static UByte PancakeHTTPServeStatic(PancakeSocket *sock); static UByte PancakeHTTPServeStatic(PancakeSocket *sock);
static UByte PancakeHTTPStaticInitialize(); static UByte PancakeHTTPStaticInitialize();
Expand Down
4 changes: 3 additions & 1 deletion HTTPStatic/PancakeHTTPStatic.h
@@ -1,10 +1,12 @@


#ifndef _PANCAKE_HTTP_STATIC_H #ifndef _PANCAKE_HTTP_STATIC_H

#include "Pancake.h" #include "Pancake.h"
#include "HTTP/PancakeHTTP.h"


#if defined(PANCAKE_HTTP) && defined(PANCAKE_HTTP_STATIC) #if defined(PANCAKE_HTTP) && defined(PANCAKE_HTTP_STATIC)


#include "HTTP/PancakeHTTP.h"

extern PancakeModule PancakeHTTPStatic; extern PancakeModule PancakeHTTPStatic;


#endif #endif
Expand Down
4 changes: 3 additions & 1 deletion Pancake.c
Expand Up @@ -3,15 +3,17 @@
#include "PancakeLogger.h" #include "PancakeLogger.h"
#include "PancakeConfiguration.h" #include "PancakeConfiguration.h"
#include "PancakeWorkers.h" #include "PancakeWorkers.h"
#include "PancakeNetwork.h"
#include "PancakeScheduler.h"


PancakeWorker *PancakeCurrentWorker; PancakeWorker *PancakeCurrentWorker;
PancakeWorker **PancakeWorkerRegistry; PancakeWorker **PancakeWorkerRegistry;
PancakeMainConfigurationStructure PancakeMainConfiguration; PancakeMainConfigurationStructure PancakeMainConfiguration;
UByte PancakeDoShutdown = 0; UByte PancakeDoShutdown = 0;


/* Forward declarations */ /* Forward declarations */
UByte PancakeConfigurationServerArchitecture(UByte step, config_setting_t *setting, PancakeConfigurationScope **scope);
static void PancakeSignalHandler(Int32 type, siginfo_t *info, void *context); static void PancakeSignalHandler(Int32 type, siginfo_t *info, void *context);
void PancakeFetchModules();


/* Here we go. */ /* Here we go. */
Int32 main(Int32 argc, Byte **argv) { Int32 main(Int32 argc, Byte **argv) {
Expand Down
1 change: 1 addition & 0 deletions Pancake.h
Expand Up @@ -20,6 +20,7 @@
#include <fcntl.h> #include <fcntl.h>
#include <ctype.h> #include <ctype.h>
#include <limits.h> #include <limits.h>
#include <time.h>


#ifdef HAVE_UCONTEXT_H #ifdef HAVE_UCONTEXT_H
# include <ucontext.h> # include <ucontext.h>
Expand Down
4 changes: 2 additions & 2 deletions PancakeConfiguration.c
Expand Up @@ -374,9 +374,9 @@ PANCAKE_API void PancakeConfigurationAddSettingToGroup(PancakeConfigurationGroup
copy->setting = child; copy->setting = child;


if(parent == NULL) { if(parent == NULL) {
HASH_ADD_KEYPTR(hh, PancakeConfiguration->settings, child->name.value, child->name.length, copy); HASH_ADD_KEYPTR(hh, PancakeConfiguration->settings, child->name.value, child->name.length, (PancakeConfigurationSetting*) copy);
} else { } else {
HASH_ADD_KEYPTR(hh, parent->settings, child->name.value, child->name.length, copy); HASH_ADD_KEYPTR(hh, parent->settings, child->name.value, child->name.length, (PancakeConfigurationSetting*) copy);
} }
} }


Expand Down
7 changes: 7 additions & 0 deletions PancakeConfiguration.h
Expand Up @@ -107,8 +107,15 @@ PANCAKE_API inline void PancakeConfigurationScopeGroupAddScope(PancakeConfigurat
PANCAKE_API inline void PancakeConfigurationActivateScopeGroup(PancakeConfigurationScopeGroup *group); PANCAKE_API inline void PancakeConfigurationActivateScopeGroup(PancakeConfigurationScopeGroup *group);
PANCAKE_API inline void PancakeConfigurationDestroyScopeGroup(PancakeConfigurationScopeGroup *group); PANCAKE_API inline void PancakeConfigurationDestroyScopeGroup(PancakeConfigurationScopeGroup *group);


/* Initialization functions */
void PancakeConfigurationInitialize();
UByte PancakeConfigurationLoad();
void PancakeConfigurationUnload();
void PancakeConfigurationDestroy();

/* Configuration Hooks */ /* Configuration Hooks */
UByte PancakeConfigurationFile(UByte step, config_setting_t *setting, PancakeConfigurationScope **scope); UByte PancakeConfigurationFile(UByte step, config_setting_t *setting, PancakeConfigurationScope **scope);
UByte PancakeConfigurationString(UByte step, config_setting_t *setting, PancakeConfigurationScope **scope); UByte PancakeConfigurationString(UByte step, config_setting_t *setting, PancakeConfigurationScope **scope);
UByte PancakeConfigurationServerArchitecture(UByte step, config_setting_t *setting, PancakeConfigurationScope **scope);


#endif #endif
1 change: 0 additions & 1 deletion PancakeDateTime.h
Expand Up @@ -3,7 +3,6 @@
#define _PANCAKE_DATE_TIME_H #define _PANCAKE_DATE_TIME_H


#include "Pancake.h" #include "Pancake.h"
#include <time.h>


PANCAKE_API String PancakeFormatDate(Native time); PANCAKE_API String PancakeFormatDate(Native time);
PANCAKE_API String PancakeFormatDateTime(Native time); PANCAKE_API String PancakeFormatDateTime(Native time);
Expand Down
1 change: 1 addition & 0 deletions PancakeNetwork.h
Expand Up @@ -130,6 +130,7 @@ PANCAKE_API void PancakeNetworkRegisterNetworkLayer(PancakeNetworkLayer *layer);
#define PancakeNetworkSetSocket(socket) (PancakeMainConfiguration.serverArchitecture->setSocket(socket)) #define PancakeNetworkSetSocket(socket) (PancakeMainConfiguration.serverArchitecture->setSocket(socket))


UByte PancakeNetworkActivate(); UByte PancakeNetworkActivate();
void PancakeNetworkUnload();


#define PANCAKE_NETWORK_CONNECTION_CACHE_KEEP 1 #define PANCAKE_NETWORK_CONNECTION_CACHE_KEEP 1
#define PANCAKE_NETWORK_CONNECTION_CACHE_REMOVE 2 #define PANCAKE_NETWORK_CONNECTION_CACHE_REMOVE 2
Expand Down

0 comments on commit 735ba56

Please sign in to comment.