diff options
-rw-r--r-- | nuttx/examples/nxflat/tests/hello++/Makefile | 6 | ||||
-rw-r--r-- | nuttx/examples/nxflat/tests/hello++/hello++2.cpp | 4 | ||||
-rw-r--r-- | nuttx/examples/nxflat/tests/hello++/hello++3.cpp | 4 | ||||
-rw-r--r-- | nuttx/examples/nxflat/tests/hello++/hello++4.cpp | 4 | ||||
-rw-r--r-- | nuttx/examples/nxflat/tests/mutex/Makefile | 2 | ||||
-rw-r--r-- | nuttx/examples/nxflat/tests/mutex/mutex.c | 1 | ||||
-rw-r--r-- | nuttx/examples/nxflat/tests/pthread/Makefile | 2 | ||||
-rw-r--r-- | nuttx/examples/nxflat/tests/pthread/pthread.c | 2 | ||||
-rw-r--r-- | nuttx/examples/nxflat/tests/signal/signal.c | 12 | ||||
-rw-r--r-- | nuttx/examples/nxflat/tests/task/task.c | 14 | ||||
-rwxr-xr-x | nuttx/libxx/libxx_delete.cxx | 1 | ||||
-rwxr-xr-x | nuttx/libxx/libxx_deletea.cxx | 1 | ||||
-rwxr-xr-x | nuttx/libxx/libxx_newa.cxx | 2 |
13 files changed, 32 insertions, 23 deletions
diff --git a/nuttx/examples/nxflat/tests/hello++/Makefile b/nuttx/examples/nxflat/tests/hello++/Makefile index dc2693219..b1c9977bc 100644 --- a/nuttx/examples/nxflat/tests/hello++/Makefile +++ b/nuttx/examples/nxflat/tests/hello++/Makefile @@ -68,7 +68,7 @@ $(CXXOBJS): %.o: %.cpp # without actually have libstdc++ $(LIBSTDC_STUBS_LIB): - $(MAKE) -C $(LIBSTDC_STUBS_DIR) + $(MAKE) -C $(LIBSTDC_STUBS_DIR) TOPDIR=$(TOPDIR) # BIN1 and BIN2 link just like C code because they contain no # static constructors. BIN1 is equivalent to a C hello world; @@ -76,10 +76,10 @@ $(LIBSTDC_STUBS_LIB): # not statically initialized. $(BIN1): $(OBJS1) - $(XFLATLD) -o $@ $^ + $(NXFLATLD) -o $@ $^ $(BIN2): $(OBJS2) $(LIBSTDC_STUBS_LIB) - $(XFLATLD) -o $@ $^ + $(NXFLATLD) -o $@ $^ # BIN3 and BIN4 require that we include --cxx in the xflat-ld command. # This will instruct xflat-ld that we want it to put togethe the correct diff --git a/nuttx/examples/nxflat/tests/hello++/hello++2.cpp b/nuttx/examples/nxflat/tests/hello++/hello++2.cpp index 4f189699e..3b03bbb0d 100644 --- a/nuttx/examples/nxflat/tests/hello++/hello++2.cpp +++ b/nuttx/examples/nxflat/tests/hello++/hello++2.cpp @@ -59,7 +59,7 @@ public: CThingSayer(void) { printf("CThingSayer::CThingSayer: I am!\n"); - szWhatToSay = NULL; + szWhatToSay = (const char*)NULL; } ~CThingSayer(void) @@ -70,7 +70,7 @@ public: printf("CThingSayer::~CThingSayer: I will never say '%s' again\n", szWhatToSay); } - szWhatToSay = NULL; + szWhatToSay = (const char*)NULL; } void Initialize(const char *czSayThis) diff --git a/nuttx/examples/nxflat/tests/hello++/hello++3.cpp b/nuttx/examples/nxflat/tests/hello++/hello++3.cpp index b41d09664..236f5def0 100644 --- a/nuttx/examples/nxflat/tests/hello++/hello++3.cpp +++ b/nuttx/examples/nxflat/tests/hello++/hello++3.cpp @@ -74,7 +74,7 @@ static CThingSayer MyThingSayer; CThingSayer::CThingSayer(void) { printf("CThingSayer::CThingSayer: I am!\n"); - szWhatToSay = NULL; + szWhatToSay = (const char*)NULL; } CThingSayer::~CThingSayer(void) @@ -85,7 +85,7 @@ CThingSayer::~CThingSayer(void) printf("CThingSayer::~CThingSayer: I will never say '%s' again\n", szWhatToSay); } - szWhatToSay = NULL; + szWhatToSay = (const char*)NULL; } void CThingSayer::Initialize(const char *czSayThis) diff --git a/nuttx/examples/nxflat/tests/hello++/hello++4.cpp b/nuttx/examples/nxflat/tests/hello++/hello++4.cpp index b6c0c488c..60c8b2a45 100644 --- a/nuttx/examples/nxflat/tests/hello++/hello++4.cpp +++ b/nuttx/examples/nxflat/tests/hello++/hello++4.cpp @@ -91,7 +91,7 @@ static CThingSayer MyThingSayer; CThingSayer::CThingSayer(void) { cout << "CThingSayer::CThingSayer: I am!" << endl; - szWhatToSay = (char*)NULL; + szWhatToSay = (const char*)NULL; } CThingSayer::~CThingSayer(void) @@ -102,7 +102,7 @@ CThingSayer::~CThingSayer(void) cout << "CThingSayer::~CThingSayer: I will never say '" << szWhatToSay << "' again" << endl; } - szWhatToSay = (char*)NULL; + szWhatToSay = (const char*)NULL; } void CThingSayer::Initialize(const char *czSayThis) diff --git a/nuttx/examples/nxflat/tests/mutex/Makefile b/nuttx/examples/nxflat/tests/mutex/Makefile index 6ba0b6736..314ed5224 100644 --- a/nuttx/examples/nxflat/tests/mutex/Makefile +++ b/nuttx/examples/nxflat/tests/mutex/Makefile @@ -47,7 +47,7 @@ all: $(BIN) $(OBJS): %.o: %.c $(NXFLATCC) -c $(NXFLATCFLAGS) $< -o $@ -$(BIN): $OBJS) +$(BIN): $(OBJS) $(NXFLATLD) $(NXFLATLDFLAGS) -o $@ $(OBJS) clean: diff --git a/nuttx/examples/nxflat/tests/mutex/mutex.c b/nuttx/examples/nxflat/tests/mutex/mutex.c index 5fdbdac5d..dc42331ee 100644 --- a/nuttx/examples/nxflat/tests/mutex/mutex.c +++ b/nuttx/examples/nxflat/tests/mutex/mutex.c @@ -38,6 +38,7 @@ ****************************************************************************/ #include <stdio.h> +#include <stdlib.h> #include <pthread.h> #include <signal.h> diff --git a/nuttx/examples/nxflat/tests/pthread/Makefile b/nuttx/examples/nxflat/tests/pthread/Makefile index eadba85ab..c1103d71c 100644 --- a/nuttx/examples/nxflat/tests/pthread/Makefile +++ b/nuttx/examples/nxflat/tests/pthread/Makefile @@ -47,7 +47,7 @@ all: $(BIN) $(OBJS): %.o: %.c $(NXFLATCC) -c $(NXFLATCFLAGS) $< -o $@ -$(BIN): $OBJS) +$(BIN): $(OBJS) $(NXFLATLD) $(NXFLATLDFLAGS) -o $@ $(OBJS) clean: diff --git a/nuttx/examples/nxflat/tests/pthread/pthread.c b/nuttx/examples/nxflat/tests/pthread/pthread.c index 89b489302..a3977b3fc 100644 --- a/nuttx/examples/nxflat/tests/pthread/pthread.c +++ b/nuttx/examples/nxflat/tests/pthread/pthread.c @@ -37,7 +37,9 @@ * Included Files ****************************************************************************/ +#include <stdio.h> #include <stdlib.h> +#include <unistd.h> #include <pthread.h> /**************************************************************************** diff --git a/nuttx/examples/nxflat/tests/signal/signal.c b/nuttx/examples/nxflat/tests/signal/signal.c index 68d96702e..52fc206d9 100644 --- a/nuttx/examples/nxflat/tests/signal/signal.c +++ b/nuttx/examples/nxflat/tests/signal/signal.c @@ -37,11 +37,13 @@ * Included Files ****************************************************************************/ -#include <stdio.h> /* For printf(), fprintf(), etc. */ -#include <signal.h> /* For signal(), sigaction(), etc. */ -#include <unistd.h> /* For usleep() */ -#include <errno.h> /* For errno */ -#include <sys/types.h> /* (needed by getpid()) */ +#include <sys/types.h> +#include <stdio.h> +#include <stdlib.h> +#include <signal.h> +#include <unistd.h> +#include <string.h> +#include <errno.h> /**************************************************************************** * Definitions diff --git a/nuttx/examples/nxflat/tests/task/task.c b/nuttx/examples/nxflat/tests/task/task.c index 28ec88d5f..969409409 100644 --- a/nuttx/examples/nxflat/tests/task/task.c +++ b/nuttx/examples/nxflat/tests/task/task.c @@ -41,6 +41,7 @@ #include <stdio.h> #include <stdlib.h> #include <unistd.h> +#include <string.h> #include <sched.h> #include <semaphore.h> #include <errno.h> @@ -49,6 +50,7 @@ * Private Data ****************************************************************************/ +static char child_name[] = "child"; static char child_arg[] = "Hello from your parent!"; static sem_t g_sem; @@ -56,7 +58,7 @@ static sem_t g_sem; * Privite Functions ****************************************************************************/ -int child_task(int argc, char **argv, char **envp) +int child_task(int argc, char **argv) { printf("Child: execv was successful!\n"); printf("Child: argc=%d\n", argc); @@ -70,9 +72,9 @@ int child_task(int argc, char **argv, char **envp) printf("Child: argv[0]=\"%s\"\n", argv[0]); - if (strcmp(argv[0], my_path) != 0) + if (strcmp(argv[0], child_name) != 0) { - printf("Child: expected argv[0] to be \"%s\"\n", my_path); + printf("Child: expected argv[0] to be \"%s\"\n", child_name); printf("Child: Exit-ting with status=3\n"); exit(3); } @@ -81,7 +83,7 @@ int child_task(int argc, char **argv, char **envp) if (strcmp(argv[1], child_arg) != 0) { - printf("Child: expected argv[1] to be \"%s\"\n", parent_arg); + printf("Child: expected argv[1] to be \"%s\"\n", child_arg); printf("Child: Exit-ting with status=4\n"); exit(4); } @@ -95,7 +97,7 @@ int child_task(int argc, char **argv, char **envp) * Public Functions ****************************************************************************/ -int main(int argc, char **argv, char **envp) +int main(int argc, char **argv) { pid_t parent_pid = getpid(); char *child_argv[2]; @@ -109,7 +111,7 @@ int main(int argc, char **argv, char **envp) child_argv[0] = child_arg; child_argv[1] = 0; - ret = task_create("child", 50, 512, child_task, &child_arg); + ret = task_create(child_name, 50, 512, child_task, child_argv); if (ret != 0) { printf("Parent: task_create failed: %d\n", errno); diff --git a/nuttx/libxx/libxx_delete.cxx b/nuttx/libxx/libxx_delete.cxx index b1d72c695..223a7bea9 100755 --- a/nuttx/libxx/libxx_delete.cxx +++ b/nuttx/libxx/libxx_delete.cxx @@ -38,6 +38,7 @@ //*************************************************************************** #include <nuttx/config.h> +#include <cstdlib> //*************************************************************************** // Definitions diff --git a/nuttx/libxx/libxx_deletea.cxx b/nuttx/libxx/libxx_deletea.cxx index 34963b6f5..3c519bd2c 100755 --- a/nuttx/libxx/libxx_deletea.cxx +++ b/nuttx/libxx/libxx_deletea.cxx @@ -38,6 +38,7 @@ //*************************************************************************** #include <nuttx/config.h> +#include <cstdlib> //*************************************************************************** // Definitions diff --git a/nuttx/libxx/libxx_newa.cxx b/nuttx/libxx/libxx_newa.cxx index 9bffb3c69..d0e5bd10b 100755 --- a/nuttx/libxx/libxx_newa.cxx +++ b/nuttx/libxx/libxx_newa.cxx @@ -65,7 +65,7 @@ //*************************************************************************** //void *operator new[](size_t size) -void *operator new[]((unsigned long size) +void *operator new[](unsigned long nbytes) { // We have to allocate something |