summaryrefslogtreecommitdiff
path: root/3rdparty/libconfig/scanctx.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-02-18 16:19:36 +0300
committerAndrei Karas <akaras@inbox.ru>2016-02-18 16:19:36 +0300
commit5b74faa8afd04771af7acb918072ea71a3db475f (patch)
tree47d24a43925e95aea6acb8ff321cb9543600fda4 /3rdparty/libconfig/scanctx.c
parent1bfb8c1283a0c662902cc8cb94d30159a9bc1183 (diff)
parent1d2eb6d23519a971db0646a146152fc6f79350f1 (diff)
downloadhercules-5b74faa8afd04771af7acb918072ea71a3db475f.tar.gz
hercules-5b74faa8afd04771af7acb918072ea71a3db475f.tar.bz2
hercules-5b74faa8afd04771af7acb918072ea71a3db475f.tar.xz
hercules-5b74faa8afd04771af7acb918072ea71a3db475f.zip
Merge pull request #1160 from MishimaHaruna/libconfig
Libconfig: update to 1.5 and various improvements
Diffstat (limited to '3rdparty/libconfig/scanctx.c')
-rw-r--r--3rdparty/libconfig/scanctx.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/3rdparty/libconfig/scanctx.c b/3rdparty/libconfig/scanctx.c
index f2fe8cd80..b3d9a6379 100644
--- a/3rdparty/libconfig/scanctx.c
+++ b/3rdparty/libconfig/scanctx.c
@@ -1,7 +1,7 @@
/* ----------------------------------------------------------------------------
libconfig - A library for processing structured configuration files
- Copyright (C) 2013-2015 Hercules Dev Team
- Copyright (C) 2005-2010 Mark A Lindner
+ Copyright (C) 2013-2016 Hercules Dev Team
+ Copyright (C) 2005-2014 Mark A Lindner
This file is part of libconfig.
@@ -40,7 +40,6 @@ static const char *err_include_too_deep = "include file nesting too deep";
static const char *__scanctx_add_filename(struct scan_context *ctx,
const char *filename)
{
-#ifndef __clang_analyzer__ // FIXME: Clang's static analyzer doesn't like this
unsigned int count = ctx->num_filenames;
const char **f;
@@ -62,7 +61,6 @@ static const char *__scanctx_add_filename(struct scan_context *ctx,
ctx->filenames[ctx->num_filenames] = filename;
++ctx->num_filenames;
-#endif // __clang_analyzer__
return(filename);
}
@@ -71,8 +69,10 @@ static const char *__scanctx_add_filename(struct scan_context *ctx,
void scanctx_init(struct scan_context *ctx, const char *top_filename)
{
memset(ctx, 0, sizeof(struct scan_context));
+#ifndef __clang_analyzer__ // FIXME: Clang's static analyzer doesn't like this
if(top_filename)
ctx->top_filename = __scanctx_add_filename(ctx, strdup(top_filename));
+#endif // __clang_analyzer__
}
/* ------------------------------------------------------------------------- */
@@ -124,7 +124,9 @@ FILE *scanctx_push_include(struct scan_context *ctx, void *buffer,
if(fp)
{
ctx->streams[ctx->depth] = fp;
+#ifndef __clang_analyzer__ // FIXME: Clang's static analyzer doesn't like this
ctx->files[ctx->depth] = __scanctx_add_filename(ctx, file);
+#endif // __clang_analyzer__
ctx->buffers[ctx->depth] = buffer;
++(ctx->depth);
}
@@ -170,4 +172,3 @@ const char *scanctx_current_filename(struct scan_context *ctx)
}
/* ------------------------------------------------------------------------- */
-/* eof */