Correct more improper global variable naming: All must begin with g_

This commit is contained in:
Gregory Nutt 2018-07-14 16:23:42 -06:00
parent 7c1082bfcc
commit e778a6990d
6 changed files with 22 additions and 14 deletions

View File

@ -1465,14 +1465,14 @@ examples/posix_spawn
Requires:
CONFIG_BINFMT_DISABLE=n - Don't disable the binary loader
CONFIG_ELF=y - Enable ELF binary loader
CONFIG_LIBC_EXECFUNCS=y - Enable support for posix_spawn
CONFIG_EXECFUNCS_SYMTAB="exports" - The name of the symbol table
created by the test.
CONFIG_EXECFUNCS_NSYMBOLS=10 - Value does not matter, it will be
corrected at runtime.
CONFIG_POSIX_SPAWN_STACKSIZE=768 - This default setting.
CONFIG_BINFMT_DISABLE=n - Don't disable the binary loader
CONFIG_ELF=y - Enable ELF binary loader
CONFIG_LIBC_EXECFUNCS=y - Enable support for posix_spawn
CONFIG_EXECFUNCS_SYMTAB="g_exports" - The name of the symbol table
created by the test.
CONFIG_EXECFUNCS_NSYMBOLS=10 - Value does not matter, it will be
corrected at runtime.
CONFIG_POSIX_SPAWN_STACKSIZE=768 - This default setting.
Test-specific configuration options:

View File

@ -30,6 +30,14 @@ config EXAMPLES_NSH_SYMTAB
and g_nexports holds the number of entries in the application symbol
table.
This is done very early in the NSH initialization sequence.
Why might you want to do this? There is really only one reason: You
would like to have the symbol tables in place early so that programs
started by NSH, perhaps via an initialization script, will have all
of the necessary symbols in place. Otherwise, you probably do *not*
want this option!
config EXAMPLES_NSH_PROGNAME
string "Program name"
default "nsh"

View File

@ -233,7 +233,7 @@ int nxflat_main(int argc, char *argv[])
*/
args[0] = NULL;
ret = exec(filename, args, exports, NEXPORTS);
ret = exec(filename, args, g_exports, NEXPORTS);
if (ret < 0)
{
errmsg("ERROR: exec(%s) failed: %d\n", dirlist[i], errno);

View File

@ -24,7 +24,7 @@ echo "#define __EXAMPLES_NXFLAT_TESTS_SYMTAB_H"
echo ""
echo "#include <nuttx/binfmt/symtab.h>"
echo ""
echo "static const struct symtab_s exports[] = "
echo "static const struct symtab_s g_exports[] = "
echo "{"
for string in $varlist; do
@ -33,7 +33,7 @@ for string in $varlist; do
done
echo "};"
echo "#define NEXPORTS (sizeof(exports)/sizeof(struct symtab_s))"
echo "#define NEXPORTS (sizeof(g_exports)/sizeof(struct symtab_s))"
echo ""
echo "#endif /* __EXAMPLES_NXFLAT_TESTS_SYMTAB_H */"

View File

@ -24,7 +24,7 @@ echo "#define __EXAMPLES_NXFLAT_TESTS_SYMTAB_H"
echo ""
echo "#include <nuttx/binfmt/symtab.h>"
echo ""
echo "static const struct symtab_s exports[] = "
echo "static const struct symtab_s g_exports[] = "
echo "{"
for string in $varlist; do
@ -33,7 +33,7 @@ for string in $varlist; do
done
echo "};"
echo "#define NEXPORTS (sizeof(exports)/sizeof(struct symtab_s))"
echo "#define NEXPORTS (sizeof(g_exports)/sizeof(struct symtab_s))"
echo ""
echo "#endif /* __EXAMPLES_NXFLAT_TESTS_SYMTAB_H */"

View File

@ -338,7 +338,7 @@ int thttp_main(int argc, char *argv[])
/* Start THTTPD. At present, symbol table info is passed via global variables */
#ifdef CONFIG_THTTPD_NXFLAT
g_thttpdsymtab = exports;
g_thttpdsymtab = g_exports;
g_thttpdnsymbols = NEXPORTS;
#endif