The GNU make CURDIR will always be a POSIX-like path with forward slashes as path segment separators. If we know that this is a native build, then we need to fix up the path so the DELIM will match the actual delimiter.
A recent change gets the APPSDIR root directory path from:
APPSDIR = $(CURDIR)
Where CURDIR is a special variable maintained by GNU make. In the native build, GNU make is provided by GNUWin32. The value of CURDIR provided by the GNUWin32 CURDIR is not POSIX, but not quite windows compatible either. It does return paths that start with C: or D:, but uses forward slashes for path segment delimiters, not backsalshes as required by Windows tools.
This fix here is to use $(CURDIR) to get the APPSDIR path for file inclusions, that part is fine. But then, if we find out we are doing a native build, the update the APPSDIR using shell %CD% environment variable which is the authoritative source of the current working directory under Windows.
Run all .c and .h files in last PR through nxstyle and fix all complaints.
Author: Xiang Xiao <xiaoxiang@xiaomi.com>
Wapi improvement (#16)
* wireless: add passphrase control
* wireless: add disconnect control
apps/netutils/dhcpd/dhcpd.c: Fix unused const variable
dhcpd.c:273:29: warning: 'g_anyipaddr' defined but not used [-Wunused-const-variable=]
static const uint8_t g_anyipaddr[4] = {0, 0, 0, 0};
apps/netutils/dhcpd: Make dhcpd interface configurable
apps/netutils/dhcpd: Lease address directly if hit in address range
apps/netutils/netinit: Initialize dhcpc_state
update the addresses only on request success
NuttX commit 346336bb9e5c9199b82e34d08bf23dd1bc389460 make CONFIG_NET_TCP_READADHEAD unselectable and removed all references to CONFIG_NET_TCP_READHEAD from the the NuttX repositories. However, there was no corresponding removal of CONFIG_NET_TCP_READHEAD from the apps/ repository. As a result, there was logic that depended on the selection of CONFIG_NET_TCP_READHEAD that could never be enabled.
This was found during build testing using the configuration olimex-lpc1766stk/thttpd-binfs. THTTPD was not being build fully because it had dependencies on CONFIG_NET_TCP_READHEAD. There resulted int numerous new warnings and, finally, the error:
(.../apps.examples.thttpd.o): in function `thttp_main':
thttpd_main.c:(.text+0x104): undefined reference to `thttpd_main'
* fix warning: format '%u' expects argument of type 'unsigned int *', but argument 3 has type 'uint16_t *
Change-Id: I3eccf8e2cd917f19b7a9edab233b327297d74bb7
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
* fix warning: format '%ld' expects argument of type 'long int', but argument 2 has type 'int'
Change-Id: Ic59a1e9e49256637fa73459c46b8cded036cf971
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
1. This fixes the issue reported in Bitbucket apps/ Issue 15. That is, if fopen() fails, the NULL stream handle would be used in subsequent logic. The handling of the failure was incomplete.
2. Some of the error handling was fixed. In the event of an error, it was return return an error value ONLY if we failure to report the error and even then the wrong error would be reported. This change now preserves and returns the correct error number that is the root cause of the failure.
3. Ran the file through tools/nxstyle and cleaned up many formatting problems.
Introduce new configuration of CONFIG_SYSTEM_ZMODEM_SNDFILEBUF, which
allocates cache buffer for reading file to be sent. This option can
improve the performance of zmodem sending file by multiple bytes read
of file, especially when the single read of file is very slow.
Author: Gregory Nutt <gnutt@nuttx.org>
Run all .c and .h affected by this PR through nxstyle.
Author: Alin Jerpelea <alin.jerpelea@sony.com>
* system/usbmsc: Fix accessing uninitialized pointer
* fsutils/inifile: Fix a memory leak in inifile error case
* fsutils/mksmartfs: Fix uninitialized return code
* system/zmodem: Fix a compile error in zmodem debug enabled
* nshlib/nsh_fscmds.c: Add syntax check to cp command
If the destication of NutShell cp command is the same with the source,
it may cause the file corruption. Add the syntax check of argument to
avoid this problem.
1.Remove void cast for function because many place ignore the returned value witout cast
2.Replace void cast for variable with UNUSED macro
Change-Id: Ie644129a563244a6397036789c4c3ea83c4e9b09
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
since the file generated by REGISTER macro don't have such suffix
Change-Id: I6814f5bd257563f897c63d9698f8892d9649dcef
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Per SUZUKI Y <NBG03015@nifty.ne.jp>, changing:
- return (FAR char *)g_nullstring;
+ return "";
causes a bad return value because "" lies on the stack.
This reverts commit 9defae8af6.
tftpc_get.c: In function 'tftp_write': tftpc_get.c:307:12: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
int fd = (int)ctx;
^
tftpc_get.c: In function 'tftpget': tftpc_get.c:368:57: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
result = tftpget_cb(remote, addr, binary, tftp_write, (void*)fd);
^
ftpc_transfer.c:652:40: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
FAR struct ftpc_session_s *session = (FAR struct ftpc_session_s *)arg1;
^
ftpc_getreply.c: In function 'fptc_getreply': ftpc_getreply.c:218:58:
warning: passing argument 3 of 'wd_start' from incompatible pointer type [-Wincompatible-pointer-types]
ret = wd_start(session->wdog, session->replytimeo, ftpc_timeout, 1, session);
^~~~~~~~~~~~
In file included from
/workspace/mirtos/out/sim/miai/mirtos/nuttx/include/nuttx/sched.h:56:0,
from /workspace/mirtos/out/sim/miai/mirtos/nuttx/include/sched.h:49,
from /workspace/mirtos/out/sim/miai/mirtos/nuttx/include/stdio.h:48,
from ftpc_internal.h:48,
from ftpc_getreply.c:46: /workspace/mirtos/out/sim/miai/mirtos/nuttx/include/nuttx/wdog.h:247:5: note: expected 'wdentry_t {aka void
(*)(int, long long unsigned int)}' but argument is of type 'void (*)(int, uint32_t) {aka void (*)(int, unsigned int)}'
int wd_start(WDOG_ID wdog, int32_t delay, wdentry_t wdentry, int argc, ...);
^~~~~~~~
apps\include" -Dmain udpblaster_target.c -o udpblaster_target.o
<command-line>:0:6: error: expected identifier or '(' before numeric constant
udpblaster_target.c:196:5: note: in expansion of macro 'main'
int main(int argc, FAR char *argv[])