nuttx/include
Gregory Nutt 3b53cd1e57 include/nuttx: Fix improper use of inline
I finally figured out why the ez80 code has gotten so big.  It is because people have been put putting big inline functions in header files.  That is a violation of the coding standard, since only c89 compatibility is required in all common code. But we have been tolerating inline function it because include/nuttx/compiler.h defines 'inline' to be nothing for C89 compilers.

As a result, static inline functions declared within a C file not so bad; the inline qualifier is ignored, if not supported, but otherwise all is well.

But it is catastrophic in header files.  Those static inline functions are included as static functions and implemented in EVERY file that includes those header files, even if the functions are never called.  That makes the code base huge!So there is another PR coming to fix some of the worst offenders.

This commit fixes two of the worst offenders I have encountered so far:  include/nuttx/sempahore.h and cache.h.  But there may be a few other changes needed.  Under include/nuttx there are still inline functions thread.h, inclue/nuttx/list.h, mutex.h, tree.h, and include/nuttx/crypto/blake2s.h with no protection for compilers that do not handler the inline qualifier.  Otherwise we are clean.

With the changes to these two header files, the size of the z20x build is reduced by about 40%.  And incredible size savings.
2020-03-02 22:06:04 +01:00
..
arpa Remove psock_send and sockfd_socket from net/socket/socket.h 2020-01-31 13:45:15 -06:00
cxx Run codespell -w with the latest dictonary again 2020-02-23 22:27:46 +01:00
net Run codespell -w with the latest dictonary again 2020-02-23 22:27:46 +01:00
netinet include/netinet/arp.h: Previous network changes broke the build test (#193) 2020-01-31 21:23:15 +01:00
netpacket Run codespell -w against all files 2020-02-22 14:45:07 -06:00
nuttx include/nuttx: Fix improper use of inline 2020-03-02 22:06:04 +01:00
sys Run codespell -w with the latest dictonary again 2020-02-23 22:27:46 +01:00
.gitignore Remove exra whitespace from files (#189) 2020-01-31 09:24:49 -06:00
aio.h sched/signal and related changes to other OS subsystems. 2019-01-27 09:28:59 -06:00
alloca.h include/alloca.h: Add alloca.h. Included limited implmentation of alloc() that is only available for GCC versions 3 and above. 2019-04-04 11:04:08 -06:00
assert.h assert: Don't define static_assert in C++ 2016-06-21 07:17:29 -04:00
crc8.h Battery monitor support (#404) 2020-02-28 18:18:50 -06:00
crc16.h
crc32.h
crc64.h include/crc64.h: fix warning: integer constant is too large for its type 2018-08-27 05:47:59 -06:00
ctype.h Costmetic changes 2016-10-24 16:18:30 -06:00
debug.h Refine the preprocessor conditional guard style (#190) 2020-01-31 19:07:39 +01:00
dirent.h libs/libc/dirent/: Added alphasort, scandir and DT_* defines 2019-07-31 07:53:14 -06:00
dlfcn.h Run codespell -w with the latest dictonary again 2020-02-23 22:27:46 +01:00
dsp.h Run codespell -w with the latest dictonary again 2020-02-23 22:27:46 +01:00
elf32.h ELF64 support (#220) 2020-02-07 17:10:23 -06:00
elf64.h ELF64 support (#220) 2020-02-07 17:10:23 -06:00
elf.h ELF64 support (#220) 2020-02-07 17:10:23 -06:00
endian.h Fix typographical error in endian.h and resource.h 2018-11-09 09:05:48 -06:00
errno.h libs/libc/unistd: Stubs for setuid and setgid. Added stubbed implementations of setuid and setgid. These functions are essentially stubs pretending that NuttX supported users and groups and that the only configured user and group in the system were both 'root' with a uid and a gid of 0, respectively. The intent is not to provide meaningful new features, but to ease porting of foreign source code to NuttX. 2019-08-06 07:17:23 -06:00
fcntl.h fcntl: add O_CLOEXEC/FD_CLOEXEC support 2020-02-20 08:20:38 -06:00
fixedmath.h Run codespell -w with the latest dictonary again 2020-02-23 22:27:46 +01:00
grp.h libc/grp: Added stubbed implementations of getgrgid, getgrgid_r, getgrnam, getgrnam_r, and initgroups. These functions are essentially stubs pretending that NuttX supported groups and that the only configured group in the system was 'root' with gid 0. The intend is not to provide meaningful new features, but to ease porting of foreign source code to NuttX. 2019-08-03 08:23:04 -06:00
hex2bin.h Squashed commit of the following: 2019-06-26 14:37:19 -06:00
inttypes.h Run codespell -w with the latest dictonary again 2020-02-23 22:27:46 +01:00
libgen.h In dlopen(), use the basename of the file as the module name 2017-01-22 16:01:03 -06:00
limits.h include/limits.h: Remove the duplicate TMP_MAX definitions. The standard require TMP_MAX define in stdio.h. 2019-03-26 09:18:14 -06:00
locale.h locale.h: Add a bogus definition of locale_t 2017-05-12 10:13:18 -06:00
lzf.h Refine the preprocessor conditional guard style (#190) 2020-01-31 19:07:39 +01:00
mqueue.h nuttx/sched/mqueue: Change 'int prio' to 'unsigned int prio'. According to open group specification, priority field in mq_* functions should have unsigned type: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/mqueue.h.html 2019-02-15 19:18:55 -06:00
netdb.h libs/libc/netdb: Implemented the netdb functions getnameinfo(), getservbyport(), and getservbyport_r(). 2019-06-30 15:12:34 -06:00
nxflat.h Run codespell -w with the latest dictonary again 2020-02-23 22:27:46 +01:00
poll.h drivers/serial/serial.c: Limit the number of times that the poll semaphore is incrmented. 2019-06-13 16:23:04 -06:00
pthread.h Run codespell -w with the latest dictonary again 2020-02-23 22:27:46 +01:00
pwd.h libc/pwd: Added stubbed implementations 2019-08-04 07:18:58 -06:00
queue.h include/queue.h: Add dq_tail marco 2018-08-27 05:57:53 -06:00
sched.h Run all .c and .h files in PR235 through tools/nxstyle. 2020-02-09 07:34:24 -06:00
semaphore.h sem_open() should return SEM_FAILED on any failures. This is change change in the POSIX specification since the original sem_open() was written so many years ago. 2017-09-08 10:14:51 -06:00
signal.h sched/signal: Add support for SIGPIPE. SIGPIPE uses SIG_SIGPIPE_ACTION which terminates process by default. It also could be ignored. 2019-10-17 11:29:39 -06:00
spawn.h Squashed commit of the following: 2019-04-29 14:52:05 -06:00
stdbool.h include/stdbool.h: Define bool only when __cplusplus isn't defined. 2019-01-27 11:25:00 -06:00
stddef.h nclude/sys/types: Move wint_t and wctype_t from wchar.h to types.h. This change is compatible as before since wchar.h include types.h indirectly. This fixes a compilation error with newlib's math.h: 'unknown type name wint_t' 2018-08-27 06:26:37 -06:00
stdint.h arch: Customize the typedef of size_t instead of intptr_t 2020-02-18 07:15:19 -06:00
stdio.h Replace #include <semaphore.h> to #include <nuttx/semaphore.h> 2020-02-01 08:27:30 -06:00
stdlib.h Run codespell -w with the latest dictonary again 2020-02-23 22:27:46 +01:00
stdnoreturn.h stdnoreturn.h: remove C++11 dependency. Applies to C too. 2017-10-02 07:38:43 -06:00
string.h libs/libc/string/Make.defs: Need to include build support for files needed when CHAR_BIT != 8. 2019-11-04 16:02:50 -06:00
strings.h Fix wait loop and void cast (#24) 2020-01-02 10:54:43 -06:00
syscall.h
syslog.h Run codespell -w against all files 2020-02-22 14:45:07 -06:00
termios.h Merged in masayuki2009/nuttx.nuttx/termios_branch (pull request #655) 2018-06-12 14:05:39 +00:00
threads.h
time.h Refine the preprocessor conditional guard style (#190) 2020-01-31 19:07:39 +01:00
unistd.h include/sys/time.h, libs/libc/unistd, sched/timer: Implement alarm(), setitimer() and getitimer() APIs. 2019-11-13 08:10:16 -06:00
wchar.h nclude/sys/types: Move wint_t and wctype_t from wchar.h to types.h. This change is compatible as before since wchar.h include types.h indirectly. This fixes a compilation error with newlib's math.h: 'unknown type name wint_t' 2018-08-27 06:26:37 -06:00
wctype.h wctype.h needs extern C 2017-02-17 09:48:55 -06:00