Commit Graph

16 Commits

Author SHA1 Message Date
liuhaitao ac84a5177d libc/time: call _NX_OPEN/_NX_CLOSE instead of open/close
Change-Id: I1d8a17ae7cac11e445dba25a8699f98186910568
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-06-04 12:10:54 +01:00
Gregory Nutt 2aabf76815 Run nxstyle against modified files in PR 2020-04-13 02:09:34 +08:00
Gregory Nutt 62c1389825 Fix warnings noted in PR build checks:
net/telnet.c:1317:40: warning: result of comparison of constant 256 with expression of type 'uint8_t' (aka 'unsigned char') is always true [-Wtautological-constant-out-of-range-compare]
                      if (priv->td_pending < CONFIG_TELNET_RXBUFFER_SIZE)
                          ~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~

    time/lib_localtime.c:569:32: warning: sizeof on pointer operation will return size of 'char *' instead of 'char [33]' [-Wsizeof-array-decay]
              sizeof(lsp->fullname - 1) <= strlen(p) + strlen(name))
                     ~~~~~~~~~~~~~ ^
2020-04-13 02:09:34 +08:00
Xiang Xiao bd4e8e19d3 Run codespell -w against all files
and fix the wrong correction
2020-02-22 14:45:07 -06:00
Gregory Nutt d202e2ef61 libs/libc/time/lib_gmtimer.c: Fix compile problem from PR317
PR317 removed definitions for SEC_PER_MIN, SEC_PER_HOUR, and SEC_PER_DAY because these were duplicates of definitions in include/nuttx/clock.h.  However, the PR did not include nuttx/clock.h so the removal of these definitions resulted in compilation failures.

Noted by Ouss4
2020-02-19 23:09:45 +01:00
chao.an 4d6e275fc4 libs/libc/time/lib_gmtimer.c: Remove duplicate definition
time/lib_gmtimer.c:54: warning: "SEC_PER_MIN" redefined
   54 | #define SEC_PER_MIN  ((time_t)60)
      |
In file included from nuttx/include/nuttx/semaphore.h:48,
                 from nuttx/include/pthread.h:56,
                 from nuttx/include/signal.h:50,
                 from nuttx/include/sys/select.h:46,
                 from nuttx/include/sys/types.h:305,
                 from nuttx/include/time.h:46,
                 from time/lib_gmtimer.c:44:
nuttx/include/nuttx/clock.h:125: note: this is the location of the previous definition
  125 | #define SEC_PER_MIN                   60L
      |
time/lib_gmtimer.c:55: warning: "SEC_PER_HOUR" redefined
   55 | #define SEC_PER_HOUR ((time_t)60 * SEC_PER_MIN)
      |
In file included from nuttx/include/nuttx/semaphore.h:48,
                 from nuttx/include/pthread.h:56,
                 from nuttx/include/signal.h:50,
                 from nuttx/include/sys/select.h:46,
                 from nuttx/include/sys/types.h:305,
                 from nuttx/include/time.h:46,
                 from time/lib_gmtimer.c:44:
nuttx/include/nuttx/clock.h:138: note: this is the location of the previous definition
  138 | #define SEC_PER_HOUR           (SEC_PER_MIN  * MIN_PER_HOUR)
      |
time/lib_gmtimer.c:56: warning: "SEC_PER_DAY" redefined
   56 | #define SEC_PER_DAY  ((time_t)24 * SEC_PER_HOUR)
      |
In file included from nuttx/include/nuttx/semaphore.h:48,
                 from nuttx/include/pthread.h:56,
                 from nuttx/include/signal.h:50,
                 from nuttx/include/sys/select.h:46,
                 from nuttx/include/sys/types.h:305,
                 from nuttx/include/time.h:46,
                 from time/lib_gmtimer.c:44:
nuttx/include/nuttx/clock.h:141: note: this is the location of the previous definition
  141 | #define SEC_PER_DAY            (HOURS_PER_DAY * SEC_PER_HOUR)
      |
2020-02-19 12:51:08 -06:00
Xiang Xiao 68951e8d72 Remove exra whitespace from files (#189)
* Remove multiple newlines at the end of files
* Remove the whitespace from the end of lines
2020-01-31 09:24:49 -06:00
Xiang Xiao 1e3f457c9e Remove TIME_EXTENDED option to more conform C standard
Gregory Nutt <gnutt@nuttx.org>

    Run all .c and .h files modified in this PR through nxstyle and correct all coding standard problems.

Xiang Xiao <xiaoxiang@xiaomi.com>

    Remove TIME_EXTENDED option to more conform C standard

    Note: the code/data size increment is small
2020-01-23 08:17:22 -06:00
Xiang Xiao 6a3c2aded6 Fix wait loop and void cast (#24)
* Simplify EINTR/ECANCEL error handling

1. Add semaphore uninterruptible wait function
2 .Replace semaphore wait loop with a single uninterruptible wait
3. Replace all sem_xxx to nxsem_xxx

* Unify the void cast usage

1. Remove void cast for function because many place ignore the returned value witout cast
2. Replace void cast for variable with UNUSED macro
2020-01-02 10:54:43 -06:00
Gregory Nutt 611eb12074 configs/makerlisp: Add Smart Flash Programmer project. Updae a README. 2019-06-12 07:38:54 -06:00
Gregory Nutt 417e681cbb libs/libc/time/lib_gmtimer.c: Spurious reorganization of a loop to work around and ZDD-II internal compiler error. Might be a little bigger now, but is also probably a more structured use of C. 2019-06-10 09:50:33 -06:00
Gregory Nutt 25f42dd076 libs/libc/time/: Costmetic changes to make gmtime() and gmtimer() follow the coding standard more closely. 2019-06-03 11:18:17 -06:00
Gregory Nutt abf6965c24 Squashed commit of the following:
libs/:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    syscall/:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    wireless/:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    Documentation/:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    include/:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    drivers/:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    sched/:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    configs:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    arch/xtensa:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    arch/z80:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    arch/x86:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    arch/renesas and arch/risc-v:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    arch/or1k:  Remove all references to CONFIG_DISABLE_SIGNALS.  Signals are always enabled.
    arch/misoc:  Remove all references to CONFIG_DISABLE_SIGNALS.  Signals are always enabled.
    arch/mips:  Remove all references to CONFIG_DISABLE_SIGNALS.  Signals are always enabled.
    arch/avr:  Remove all references to CONFIG_DISABLE_SIGNALS.  Signals are always enabled.
    arch/arm:  Remove all references to CONFIG_DISABLE_SIGNALS.  Signals are always enabled.
2019-04-29 14:52:05 -06:00
Alan Carvalho de Assis 283b73edc5 Fix lots of typos in C comments and Kconfig help text 2018-07-08 18:24:45 -06:00
Gregory Nutt 8fca244f36 syscall: clock_systimer() is no longer a system call. It has been replaced with the equivalent, standard interface clock() as the system call.
sched/clock:  Move the implementation of clock() from libs/libc/time to sched/clock.  This is necessary because it calls the (now) internal OS function clock_systimer.  clock() is now accessed only via a system call in certain configuratins.
libs/libc/wqueue:  Replace calls to clock_systimer() with calls to the equivalent clock().
2018-06-16 12:50:28 -06:00
Gregory Nutt cf99fb40c9 This commit moves all of the libraries under a common directory called libs/. This most certainly break libcxx and uClibc++ for now.
Squashed commit of the following:

    libs/libxx:  Fix some confusing in naming.  If the directory is called libxx, then the library must be libxx.a (unless perhaps LIBCXX is selected).
    libs/:  Fix paths in moved library directories.
    libs:  Brute force move of libc, libnx, and libxx to libs.  Cannot yet build it in that configuration.
2018-05-29 13:21:26 -06:00