Some ISO C fixes
This patch just fixes a limited number of bits not conforming to c99 by using
- __asm__ instead of just asm
- {0} instead of {} for struct initialization
- h_addr_list[0] instead of h_addr to access the host address in
struct hostent
- #include <strings.h> where needed (for ffs and strcasecmp)
Based on a previous patch by Carl-Daniel.
Corresponding to flashrom svn r1585.
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
diff --git a/hwaccess.h b/hwaccess.h
index 12496bb..dc52118 100644
--- a/hwaccess.h
+++ b/hwaccess.h
@@ -174,7 +174,6 @@
/* for iopl and outb under Solaris */
#if defined (__sun) && (defined(__i386) || defined(__amd64))
-#include <strings.h>
#include <sys/sysi86.h>
#include <sys/psw.h>
#include <asm/sunddi.h>
@@ -263,37 +262,37 @@
static inline void outb(uint8_t value, uint16_t port)
{
- asm volatile ("outb %b0,%w1": :"a" (value), "Nd" (port));
+ __asm__ volatile ("outb %b0,%w1": :"a" (value), "Nd" (port));
}
static inline uint8_t inb(uint16_t port)
{
uint8_t value;
- asm volatile ("inb %w1,%0":"=a" (value):"Nd" (port));
+ __asm__ volatile ("inb %w1,%0":"=a" (value):"Nd" (port));
return value;
}
static inline void outw(uint16_t value, uint16_t port)
{
- asm volatile ("outw %w0,%w1": :"a" (value), "Nd" (port));
+ __asm__ volatile ("outw %w0,%w1": :"a" (value), "Nd" (port));
}
static inline uint16_t inw(uint16_t port)
{
uint16_t value;
- asm volatile ("inw %w1,%0":"=a" (value):"Nd" (port));
+ __asm__ volatile ("inw %w1,%0":"=a" (value):"Nd" (port));
return value;
}
static inline void outl(uint32_t value, uint16_t port)
{
- asm volatile ("outl %0,%w1": :"a" (value), "Nd" (port));
+ __asm__ volatile ("outl %0,%w1": :"a" (value), "Nd" (port));
}
static inline uint32_t inl(uint16_t port)
{
uint32_t value;
- asm volatile ("inl %1,%0":"=a" (value):"Nd" (port));
+ __asm__ volatile ("inl %1,%0":"=a" (value):"Nd" (port));
return value;
}
#endif