Move MAX, MIN and ABS to sys/cc.h

This commit is contained in:
Moritz 'Morty' Strübe 2014-12-01 13:58:34 +01:00
parent c9324d133f
commit 0dab6926b3
33 changed files with 41 additions and 93 deletions

View file

@ -36,6 +36,7 @@
* Matthias Kovatsch <kovatsch@inf.ethz.ch>
*/
#include "sys/cc.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

View file

@ -36,6 +36,7 @@
* Matthias Kovatsch <kovatsch@inf.ethz.ch>
*/
#include "sys/cc.h"
#include <stdio.h>
#include <string.h>
#include "er-coap-separate.h"

View file

@ -39,6 +39,7 @@
#include <string.h>
#include <stdio.h>
#include "contiki.h"
#include "sys/cc.h"
#include "contiki-net.h"
#include "er-coap.h"

View file

@ -79,10 +79,6 @@ enum { OPTION_MAP_SIZE = sizeof(uint8_t) * 8 };
#define SET_OPTION(packet, opt) ((packet)->options[opt / OPTION_MAP_SIZE] |= 1 << (opt % OPTION_MAP_SIZE))
#define IS_OPTION(packet, opt) ((packet)->options[opt / OPTION_MAP_SIZE] & (1 << (opt % OPTION_MAP_SIZE)))
#ifndef MIN
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#endif /* MIN */
/* parsed message struct */
typedef struct {
uint8_t *buffer; /* pointer to CoAP header / incoming packet buffer / memory to serialize packet */

View file

@ -57,13 +57,12 @@
#include "lib/assert.h"
#include "lib/list.h"
#include "sys/cc.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
/*---------------------------------------------------------------------------*/
#define MIN(a, b) ((a) < (b) ? (a) : (b))
/*---------------------------------------------------------------------------*/
#define DEBUG 0
#if DEBUG
#define PRINTF(...) PRINTF(__VA_ARGS__)

View file

@ -62,10 +62,6 @@
#define REST_MAX_CHUNK_SIZE 64
#endif
#ifndef MIN
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#endif /* MIN */
struct resource_s;
struct periodic_resource_s;

View file

@ -42,6 +42,7 @@
#include "sys/energest.h"
#include <stdio.h>
#include "sys/cc.h"
struct power_msg {
uint16_t len;

View file

@ -38,6 +38,7 @@
*/
#include "contiki.h"
#include "sys/cc.h"
#include "shell-sky.h"
#include "dev/watchdog.h"
@ -84,8 +85,6 @@ SHELL_COMMAND(rfchannel_command,
"rfchannel <channel>: change CC2420 radio channel (11 - 26)",
&shell_rfchannel_process);
/*---------------------------------------------------------------------------*/
#define MAX(a, b) ((a) > (b)? (a): (b))
#define MIN(a, b) ((a) < (b)? (a): (b))
struct spectrum {
int channel[16];
};

View file

@ -36,13 +36,10 @@
#include <stddef.h>
#include "contiki.h"
#include "sys/cc.h"
#include "shell.h"
#include "telnet.h"
#ifndef MIN
#define MIN(a, b) ((a) < (b)? (a) : (b))
#endif /* MIN */
/*---------------------------------------------------------------------------*/
PROCESS(shell_tcpsend_process, "tcpsend");
SHELL_COMMAND(tcpsend_command,

View file

@ -38,6 +38,7 @@
*/
#include "contiki.h"
#include "sys/cc.h"
#include "shell-time.h"
#include "sys/clock.h"
@ -51,11 +52,6 @@
#define MAX_COMMANDLENGTH 64
#define PERIOD_INTERVAL 60
#ifndef MIN
#define MIN(a, b) ((a) < (b)? (a) : (b))
#endif /* MIN */
/*---------------------------------------------------------------------------*/
PROCESS(shell_time_process, "time");
SHELL_COMMAND(time_command,

View file

@ -33,6 +33,7 @@
#include <string.h>
#include "sys/cc.h"
#include "contiki-lib.h"
#include "contiki-net.h"
#include "lib/petsciiconv.h"
@ -103,7 +104,6 @@ static uint8_t connected;
#define MAX_SILENCE_TIME (CLOCK_SECOND * 30)
#define MIN(a, b) ((a) < (b)? (a): (b))
/*---------------------------------------------------------------------------*/
static void
buf_init(struct telnetd_buf *buf)