apps: Use MIN/MAX definitions from "sys/param.h"
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
This commit is contained in:
parent
e949e207e0
commit
b0da60e498
@ -25,6 +25,7 @@
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/param.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <fcntl.h>
|
||||
@ -54,16 +55,6 @@
|
||||
|
||||
#define FULL_RANGE 16
|
||||
|
||||
/* Helpers ******************************************************************/
|
||||
|
||||
#ifndef MIN
|
||||
# define MIN(a,b) ((a) < (b) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
#ifndef MAX
|
||||
# define MAX(a,b) ((a) > (b) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/param.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <fcntl.h>
|
||||
@ -51,16 +52,6 @@
|
||||
# define CONFIG_EXAMPLES_DJOYSTICK_SIGNO 13
|
||||
#endif
|
||||
|
||||
/* Helpers ******************************************************************/
|
||||
|
||||
#ifndef MIN
|
||||
# define MIN(a,b) ((a) < (b) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
#ifndef MAX
|
||||
# define MAX(a,b) ((a) > (b) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
@ -24,6 +24,7 @@
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/types.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
@ -35,14 +36,6 @@
|
||||
#include <nuttx/lib/modlib.h>
|
||||
#include <nuttx/fs/fs.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef MIN
|
||||
# define MIN(a,b) ((a) < (b) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private data
|
||||
****************************************************************************/
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/param.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <fcntl.h>
|
||||
@ -50,16 +51,6 @@
|
||||
|
||||
#define FULL_RANGE 16
|
||||
|
||||
/* Helpers ******************************************************************/
|
||||
|
||||
#ifndef MIN
|
||||
# define MIN(a,b) ((a) < (b) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
#ifndef MAX
|
||||
# define MAX(a,b) ((a) > (b) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <semaphore.h>
|
||||
#include <sys/param.h>
|
||||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
|
||||
@ -66,13 +67,6 @@
|
||||
# error "Unsupported CONFIG_EXAMPLES_NXDEMO_BPP"
|
||||
#endif
|
||||
|
||||
#ifndef MIN
|
||||
# define MIN(a,b) ((a) < (b) ? (a) : (b))
|
||||
#endif
|
||||
#ifndef MAX
|
||||
# define MAX(a,b) ((a) > (b) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <sys/param.h>
|
||||
#include <debug.h>
|
||||
#include <fixedmath.h>
|
||||
#include <inttypes.h>
|
||||
@ -52,10 +53,6 @@
|
||||
# define CLEAR_WIDTH CONFIG_EXAMPLES_NXLINES_LINEWIDTH
|
||||
#endif
|
||||
|
||||
#ifndef MIN
|
||||
# define MIN(a,b) ((a) < (b) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <semaphore.h>
|
||||
#include <sys/param.h>
|
||||
#include <fixedmath.h>
|
||||
|
||||
#include <nuttx/nx/nx.h>
|
||||
@ -151,15 +152,6 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Helpers */
|
||||
|
||||
#ifndef MIN
|
||||
# define MIN(a,b) ((a) < (b) ? (a) : (b))
|
||||
#endif
|
||||
#ifndef MAX
|
||||
# define MAX(a,b) ((a) > (b) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/param.h>
|
||||
#include <inttypes.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
@ -52,10 +53,6 @@
|
||||
# define CLEAR_WIDTH CONFIG_EXAMPLES_PWLINES_LINEWIDTH
|
||||
#endif
|
||||
|
||||
#ifndef MIN
|
||||
# define MIN(a,b) ((a) < (b) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
@ -27,6 +27,8 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <sys/param.h>
|
||||
|
||||
#include <arpa/inet.h>
|
||||
|
||||
/****************************************************************************
|
||||
@ -102,10 +104,6 @@
|
||||
# error "Additional link layer definitions needed"
|
||||
#endif
|
||||
|
||||
#ifndef MIN
|
||||
# define MIN(a,b) ((a) < (b) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
#define UDPBLASTER_SENDSIZE MIN(UDPBLASTER_MSS, g_udpblaster_strlen)
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/param.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <fcntl.h>
|
||||
@ -51,16 +52,6 @@
|
||||
# define CONFIG_EXAMPLES_ZEROCROSS_SIGNO 13
|
||||
#endif
|
||||
|
||||
/* Helpers ******************************************************************/
|
||||
|
||||
#ifndef MIN
|
||||
# define MIN(a,b) ((a) < (b) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
#ifndef MAX
|
||||
# define MAX(a,b) ((a) > (b) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
@ -31,6 +31,7 @@
|
||||
#include <cstdio>
|
||||
#include <semaphore.h>
|
||||
#include <debug.h>
|
||||
#include <sys/param.h>
|
||||
|
||||
#include <nuttx/nx/nx.h>
|
||||
|
||||
@ -61,12 +62,6 @@
|
||||
# define CONFIG_CGLYPHBUTTONTEST_FONTCOLOR CONFIG_NXWIDGETS_DEFAULT_FONTCOLOR
|
||||
#endif
|
||||
|
||||
// Helper macros
|
||||
|
||||
#ifndef MAX
|
||||
# define MAX(a,b) ((a) > (b) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Public Classes
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -37,6 +37,7 @@
|
||||
|
||||
#include <cstdio>
|
||||
#include <cerrno>
|
||||
#include <sys/param.h>
|
||||
|
||||
#include <nuttx/nx/nxbe.h>
|
||||
|
||||
@ -64,10 +65,6 @@
|
||||
|
||||
#define makemult(a,b) ((b == 1) ? (a) : (((int)((a) / (b))) * (b)))
|
||||
|
||||
#ifndef MIN
|
||||
# define MIN(a,b) ((a) < (b) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Class Implementations
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -42,6 +42,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/param.h>
|
||||
#include <debug.h>
|
||||
#include <poll.h>
|
||||
#include <debug.h>
|
||||
@ -68,10 +69,6 @@
|
||||
# define fwinfo _none
|
||||
#endif
|
||||
|
||||
#ifndef MIN
|
||||
# define MIN(a,b) ((a) < (b) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
@ -44,6 +44,7 @@
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/time.h>
|
||||
@ -62,16 +63,6 @@
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* A few convenient defines. */
|
||||
|
||||
#ifndef MAX
|
||||
# define MAX(a,b) ((a) > (b) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
#ifndef MIN
|
||||
# define MIN(a,b) ((a) < (b) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
/* Enable special instrumentation to track down "400 Bad Request" problems */
|
||||
|
||||
#undef CONFIG_THTTPD_BADREQUEST /* Define to enable "Bad Request" instrumentation */
|
||||
|
@ -24,6 +24,7 @@
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/types.h>
|
||||
#include <stdlib.h>
|
||||
#include <malloc.h>
|
||||
@ -35,18 +36,6 @@
|
||||
|
||||
#ifdef CONFIG_THTTPD
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef MAX
|
||||
# define MAX(a,b) ((a) > (b) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
#ifndef MIN
|
||||
# define MIN(a,b) ((a) < (b) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
@ -28,6 +28,7 @@
|
||||
|
||||
#include <nuttx/compiler.h>
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/stat.h> /* Needed for open */
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
@ -116,12 +117,6 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Get the larger value */
|
||||
|
||||
#ifndef MAX
|
||||
# define MAX(a,b) ((a) > (b) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/param.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nuttx/input/buttons.h>
|
||||
@ -39,10 +40,6 @@
|
||||
#define DELAY_MS(ms) usleep((ms) * 1000)
|
||||
#define ABS(a) ((a) > 0 ? (a) : -(a))
|
||||
|
||||
#ifndef MAX
|
||||
# define MAX(a,b) ((a) > (b) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
@ -41,6 +41,7 @@
|
||||
#include <nuttx/video/fb.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <system/nxcamera.h>
|
||||
@ -58,10 +59,6 @@
|
||||
#define NXCAMERA_STATE_LOOPING 2
|
||||
#define NXCAMERA_STATE_PAUSED 3
|
||||
|
||||
#ifndef MIN
|
||||
# define MIN(a, b) (((a) < (b)) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
#define convert_frame ConvertToARGB
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -24,6 +24,7 @@
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
@ -55,10 +56,6 @@
|
||||
#define AUDIO_APB_RECORD (1 << 4)
|
||||
#define AUDIO_APB_PLAY (1 << 5)
|
||||
|
||||
#ifndef MIN
|
||||
# define MIN(a, b) (((a) < (b)) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sys/param.h>
|
||||
#include <unistd.h>
|
||||
#include <pthread.h>
|
||||
#include <semaphore.h>
|
||||
@ -48,10 +49,6 @@
|
||||
#define sched_lock()
|
||||
#define sched_unlock()
|
||||
|
||||
#ifndef MIN
|
||||
# define MIN(a,b) ((a) < (b) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
@ -26,6 +26,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/param.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <pthread.h>
|
||||
@ -49,13 +50,6 @@
|
||||
#define PRIO_HI_NDX 0
|
||||
#define PRIO_LO_NDX 1
|
||||
|
||||
#ifndef MIN
|
||||
# define MIN(a,b) ((a) < (b) ? (a) : (b))
|
||||
#endif
|
||||
#ifndef MAX
|
||||
# define MAX(a,b) ((a) > (b) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
@ -36,6 +36,7 @@
|
||||
#include <poll.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <netinet/in.h>
|
||||
@ -58,10 +59,6 @@
|
||||
# define gs2200m_printf(v, ...)
|
||||
#endif
|
||||
|
||||
#ifndef MIN
|
||||
# define MIN(a,b) ((a) < (b) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
#define SOCKET_BASE 10000
|
||||
#define SOCKET_COUNT 16
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user