Permalink
Browse files

Fix some compiler warnings / cleanup

  • Loading branch information...
pp3345 committed Apr 21, 2014
1 parent 7dc511c commit 735ba56691aecb94989988cbf81c79b4aefc4711
@@ -531,7 +531,6 @@ static int __config_read(config_t *config, FILE *stream, const char *filename,
yyscan_t scanner;
struct scan_context scan_ctx;
struct parse_context parse_ctx;
YY_BUFFER_STATE buffer = NULL;
int r;

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

PancakeConfigurationParser_yyset_lineno(1, scanner);
r = PancakeConfigurationParser_yyparse(scanner, &parse_ctx, &scan_ctx);
@@ -1,9 +1,11 @@
#include "PancakeHTTP.h"
#include "PancakeConfiguration.h"
#include "PancakeLogger.h"

#ifdef PANCAKE_HTTP

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

#ifdef PANCAKE_HTTP_REWRITE
#include "HTTPRewrite/PancakeHTTPRewrite.h"
#endif
@@ -157,6 +157,7 @@ PANCAKE_API inline UByte PancakeHTTPServeContent(PancakeSocket *sock, UByte igno
PANCAKE_API void PancakeHTTPException(PancakeSocket *sock, UInt16 code);
PANCAKE_API inline void PancakeHTTPOnRemoteHangup(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 PancakeHTTPSendChunk(PancakeSocket *sock, String *chunk);
PANCAKE_API inline void PancakeHTTPSendLastChunk(PancakeSocket *sock);
@@ -121,7 +121,7 @@ static UByte PancakeHTTPRewriteCompile(UByte step, config_setting_t *setting, Pa
// Lookup variable or function
if(setting->op == CONFIG_OP_CALL) {
HASH_FIND(hh, callbacks, setting->name, length, callback);
PancakeAssert(var != NULL);
PancakeAssert(callback != NULL);
} else {
HASH_FIND(hh, variables, setting->name, length, var);
PancakeAssert(var != NULL);
@@ -1,9 +1,11 @@

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

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

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

/* Forward declarations */
static UByte PancakeHTTPServeStatic(PancakeSocket *sock);
static UByte PancakeHTTPStaticInitialize();
@@ -1,10 +1,12 @@

#ifndef _PANCAKE_HTTP_STATIC_H

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

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

#include "HTTP/PancakeHTTP.h"

extern PancakeModule PancakeHTTPStatic;

#endif
@@ -3,15 +3,17 @@
#include "PancakeLogger.h"
#include "PancakeConfiguration.h"
#include "PancakeWorkers.h"
#include "PancakeNetwork.h"
#include "PancakeScheduler.h"

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

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

/* Here we go. */
Int32 main(Int32 argc, Byte **argv) {
@@ -20,6 +20,7 @@
#include <fcntl.h>
#include <ctype.h>
#include <limits.h>
#include <time.h>

#ifdef HAVE_UCONTEXT_H
# include <ucontext.h>
@@ -374,9 +374,9 @@ PANCAKE_API void PancakeConfigurationAddSettingToGroup(PancakeConfigurationGroup
copy->setting = child;

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 {
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);
}
}

@@ -107,8 +107,15 @@ PANCAKE_API inline void PancakeConfigurationScopeGroupAddScope(PancakeConfigurat
PANCAKE_API inline void PancakeConfigurationActivateScopeGroup(PancakeConfigurationScopeGroup *group);
PANCAKE_API inline void PancakeConfigurationDestroyScopeGroup(PancakeConfigurationScopeGroup *group);

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

/* Configuration Hooks */
UByte PancakeConfigurationFile(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
@@ -3,7 +3,6 @@
#define _PANCAKE_DATE_TIME_H

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

PANCAKE_API String PancakeFormatDate(Native time);
PANCAKE_API String PancakeFormatDateTime(Native time);
@@ -130,6 +130,7 @@ PANCAKE_API void PancakeNetworkRegisterNetworkLayer(PancakeNetworkLayer *layer);
#define PancakeNetworkSetSocket(socket) (PancakeMainConfiguration.serverArchitecture->setSocket(socket))

UByte PancakeNetworkActivate();
void PancakeNetworkUnload();

#define PANCAKE_NETWORK_CONNECTION_CACHE_KEEP 1
#define PANCAKE_NETWORK_CONNECTION_CACHE_REMOVE 2

0 comments on commit 735ba56

Please sign in to comment.