From 3ec4b267fcd061a2010c31e8446e642790bd8352 Mon Sep 17 00:00:00 2001 From: Mariano Alvira Date: Wed, 10 Nov 2010 15:44:38 -0500 Subject: [PATCH] use stdint.h instead of custom types.h stdint.h is more portable across compilers --- lib/gpio.c | 2 +- lib/include/crm.h | 2 +- lib/include/isr.h | 2 ++ lib/include/maca.h | 2 +- lib/include/mc1322x.h | 1 - lib/include/nvm.h | 2 +- lib/include/types.h | 48 ------------------------------------------- lib/include/uart1.h | 2 +- lib/printf.c | 2 +- lib/uart1.c | 2 +- 10 files changed, 9 insertions(+), 56 deletions(-) delete mode 100644 lib/include/types.h diff --git a/lib/gpio.c b/lib/gpio.c index 03849c0ee..ed1582ce1 100644 --- a/lib/gpio.c +++ b/lib/gpio.c @@ -34,7 +34,7 @@ */ #include -#include +#include inline void gpio_pad_dir(volatile uint64_t data) { diff --git a/lib/include/crm.h b/lib/include/crm.h index 93c2b4b31..f63a72db1 100644 --- a/lib/include/crm.h +++ b/lib/include/crm.h @@ -36,7 +36,7 @@ #ifndef CRM_H #define CRM_H -#include +#include #define CRM_BASE (0x80003000) diff --git a/lib/include/isr.h b/lib/include/isr.h index a63215ce8..6e5102526 100644 --- a/lib/include/isr.h +++ b/lib/include/isr.h @@ -36,6 +36,8 @@ #ifndef ISR_H #define ISR_H +#include + #define INTBASE (0x80020000) /* Structure-based ITC access */ diff --git a/lib/include/maca.h b/lib/include/maca.h index 4d2e14472..24c10ce3d 100644 --- a/lib/include/maca.h +++ b/lib/include/maca.h @@ -37,7 +37,7 @@ #define _MACA_H_ #include -#include +#include #include /* maca initialization and on off routines */ diff --git a/lib/include/mc1322x.h b/lib/include/mc1322x.h index bf61e52d5..a05a48744 100644 --- a/lib/include/mc1322x.h +++ b/lib/include/mc1322x.h @@ -36,7 +36,6 @@ #ifndef MC1322X_H #define MC1322X_H -#include "types.h" #include "isr.h" #include "gpio.h" #include "crm.h" diff --git a/lib/include/nvm.h b/lib/include/nvm.h index 05ad7a670..5a78be441 100644 --- a/lib/include/nvm.h +++ b/lib/include/nvm.h @@ -36,7 +36,7 @@ #ifndef NVM_H #define NVM_H -#include "types.h" +#include typedef enum { diff --git a/lib/include/types.h b/lib/include/types.h deleted file mode 100644 index 7e66a045b..000000000 --- a/lib/include/types.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2010, Mariano Alvira and other contributors - * to the MC1322x project (http://mc1322x.devl.org) - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * This file is part of libmc1322x: see http://mc1322x.devl.org - * for details. - * - * $Id$ - */ - -#ifndef _TYPES_H -#define _TYPES_H - -typedef signed char int8_t; -typedef unsigned char uint8_t; -typedef signed short int16_t; -typedef unsigned short uint16_t; -typedef signed int int32_t; -typedef unsigned int uint32_t; -typedef signed long long int int64_t; -typedef unsigned long long int uint64_t; - -#endif diff --git a/lib/include/uart1.h b/lib/include/uart1.h index 0b0ef08e8..3feab2279 100644 --- a/lib/include/uart1.h +++ b/lib/include/uart1.h @@ -36,7 +36,7 @@ #ifndef UART1_H #define UART1_H -#include +#include #define UCON (0) /* UCON bits */ diff --git a/lib/printf.c b/lib/printf.c index 64da212a8..d43ea1c28 100644 --- a/lib/printf.c +++ b/lib/printf.c @@ -70,7 +70,7 @@ #include #include -#include +#include #define __putc(x) uart1_putc(x) diff --git a/lib/uart1.c b/lib/uart1.c index b5bd78011..87ac10223 100644 --- a/lib/uart1.c +++ b/lib/uart1.c @@ -34,7 +34,7 @@ */ #include -#include +#include volatile char u1_tx_buf[64]; volatile uint32_t u1_head, u1_tail;