3 * Politecnico di Torino. All rights reserved.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that: (1) source code distributions
7 * retain the above copyright notice and this paragraph in its entirety, (2)
8 * distributions including binary code include the above copyright notice and
9 * this paragraph in its entirety in the documentation or other materials
10 * provided with the distribution, and (3) all advertising materials mentioning
11 * features or use of this software display the following acknowledgement:
12 * ``This product includes software developed by the Politecnico
13 * di Torino, and its contributors.'' Neither the name of
14 * the University nor the names of its contributors may be used to endorse
15 * or promote products derived from this software without specific prior
17 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
18 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
19 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27 int32 SW_LONG_AT(void *b, uint32 c)
29 return ((int32)*((uint8 *)b+c)<<24|
30 (int32)*((uint8 *)b+c+1)<<16|
31 (int32)*((uint8 *)b+c+2)<<8|
32 (int32)*((uint8 *)b+c+3)<<0);
35 uint32 SW_ULONG_AT(void *b, uint32 c)
37 return ((uint32)*((uint8 *)b+c)<<24|
38 (uint32)*((uint8 *)b+c+1)<<16|
39 (uint32)*((uint8 *)b+c+2)<<8|
40 (uint32)*((uint8 *)b+c+3)<<0);
43 int16 SW_SHORT_AT(void *b, uint32 os)
46 ((int16)*((uint8 *)b+os+0)<<8|
47 (int16)*((uint8 *)b+os+1)<<0));
50 uint16 SW_USHORT_AT(void *b, uint32 os)
53 ((uint16)*((uint8 *)b+os+0)<<8|
54 (uint16)*((uint8 *)b+os+1)<<0));
57 VOID SW_ULONG_ASSIGN(void *dst, uint32 src)
59 *((uint8*)dst+0)=*((uint8*)&src+3);
60 *((uint8*)dst+1)=*((uint8*)&src+2);
61 *((uint8*)dst+2)=*((uint8*)&src+1);
62 *((uint8*)dst+3)=*((uint8*)&src+0);
66 #endif /*_USE_SW_FUNCS_*/
68 void assert(void* assert, const char* file, int line, void* msg) { };