Changeset 369
- Timestamp:
- 05/22/15 13:21:44 (10 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/nv/core/common.hh
r368 r369 125 125 #endif 126 126 127 #include <typeinfo>128 #include <iterator>129 #include <cstddef>130 #include <cstdint>131 127 #include <cassert> 132 //#include <nv/core/logging.hh>133 128 134 129 #define NV_STRINGIZE_DETAIL(x) #x … … 184 179 185 180 // Typedefs for fixed size types. 186 typedef int8_t sint8; 187 typedef int16_t sint16; 188 typedef int32_t sint32; 189 typedef int64_t sint64; 190 191 typedef uint8_t uint8; 192 typedef uint16_t uint16; 193 typedef uint32_t uint32; 194 typedef uint64_t uint64; 195 196 typedef unsigned char char8; 197 typedef unsigned short char16; 198 typedef unsigned long char32; 199 200 typedef float f32; 201 typedef double f64; 202 203 typedef uint64 uid; 181 typedef signed char sint8; 182 typedef signed short sint16; 183 typedef signed int sint32; 184 185 typedef unsigned char uint8; 186 typedef unsigned short uint16; 187 typedef unsigned int uint32; 188 189 #if NV_COMPILER == NV_MSVC 190 typedef signed __int64 sint64; 191 typedef unsigned __int64 uint64; 192 #else 193 typedef signed long long sint64; 194 typedef unsigned long long uint64; 195 #endif 196 typedef unsigned char uchar8; 197 typedef unsigned short uchar16; 198 typedef unsigned int uchar32; 199 200 typedef signed char schar8; 201 typedef signed short schar16; 202 typedef signed long schar32; 203 204 typedef float f32; 205 typedef double f64; 206 207 typedef uint64 uid; 204 208 205 209 struct empty_type {}; 206 210 211 template < typename T > 212 class empty_base_class {}; 213 207 214 template < int a, int b, int c, int d > 208 209 215 struct four_cc 210 216 { … … 254 260 } 255 261 262 static_assert( sizeof( nv::sint8 ) == 1, "sint8 size isn't 1 bytes" ); 263 static_assert( sizeof( nv::sint16 ) == 2, "sint16 size isn't 2 bytes" ); 264 static_assert( sizeof( nv::sint32 ) == 4, "sint32 size isn't 4 bytes" ); 265 static_assert( sizeof( nv::sint64 ) == 8, "sint64 size isn't 8 bytes" ); 266 267 static_assert( sizeof( nv::uint8 ) == 1, "uint8 size isn't 1 byte" ); 268 static_assert( sizeof( nv::uint16 ) == 2, "uint16 size isn't 2 bytes" ); 269 static_assert( sizeof( nv::uint32 ) == 4, "uint32 size isn't 4 bytes" ); 270 static_assert( sizeof( nv::uint64 ) == 8, "uint64 size isn't 8 bytes" ); 271 272 static_assert( sizeof( nv::f32 ) == 4, "float32 size isn't 4 bytes" ); 273 static_assert( sizeof( nv::f64 ) == 8, "float64 size isn't 8 bytes" ); 274 275 256 276 #endif // NV_CORE_COMMON_HH -
trunk/nv/core/io_event.hh
r357 r369 46 46 { 47 47 /// Input event ASCII code 48 char8 ascii;48 uchar8 ascii; 49 49 50 50 /// Input event local code -
trunk/nv/core/property_store.hh
r352 r369 15 15 16 16 #include <nv/core/common.hh> 17 #include <nv/ core/handle.hh>17 #include <nv/stl/handle.hh> 18 18 19 19 namespace nv -
trunk/nv/stl/cstring_store.hh
r368 r369 15 15 16 16 #include <nv/core/common.hh> 17 #include <nv/ core/array.hh>17 #include <nv/stl/array.hh> 18 18 #include <unordered_map> 19 19 #include <cstring> -
trunk/nv/stl/memory.hh
r368 r369 24 24 namespace detail 25 25 { 26 template < typename T >27 class empty_base_class {};28 29 26 template < typename PARENT, typename T, bool CONST, typename BASE = empty_base_class<PARENT> > 30 27 class pointer_iterators {}; -
trunk/src/curses/curses_terminal.cc
r337 r369 108 108 if ( result >= 32 && result < 128 ) 109 109 { 110 kevent.key.ascii = static_cast<nv:: char8>(result);110 kevent.key.ascii = static_cast<nv::uchar8>(result); 111 111 } 112 112 -
trunk/src/lua/lua_glm.cc
r368 r369 360 360 { 361 361 for (size_t i = 0; i < 256; ++i ) nlua_swizzel_lookup[i] = 255; 362 using nv:: char8;363 nlua_swizzel_lookup[ char8( 'x' )] = 0;364 nlua_swizzel_lookup[ char8( 'r' )] = 0;365 nlua_swizzel_lookup[ char8( 's' )] = 0;366 nlua_swizzel_lookup[ char8( '0' )] = 0;367 nlua_swizzel_lookup[ char8( 'y' )] = 1;368 nlua_swizzel_lookup[ char8( 'g' )] = 1;369 nlua_swizzel_lookup[ char8( 't' )] = 0;370 nlua_swizzel_lookup[ char8( '1' )] = 1;371 nlua_swizzel_lookup[ char8( 'z' )] = 2;372 nlua_swizzel_lookup[ char8( 'b' )] = 2;373 nlua_swizzel_lookup[ char8( 'u' )] = 0;374 nlua_swizzel_lookup[ char8( '2' )] = 2;375 nlua_swizzel_lookup[ char8( 'w' )] = 3;376 nlua_swizzel_lookup[ char8( 'a' )] = 3;377 nlua_swizzel_lookup[ char8( 'v' )] = 0;378 nlua_swizzel_lookup[ char8( '3' )] = 3;362 using nv::uchar8; 363 nlua_swizzel_lookup[uchar8( 'x' )] = 0; 364 nlua_swizzel_lookup[uchar8( 'r' )] = 0; 365 nlua_swizzel_lookup[uchar8( 's' )] = 0; 366 nlua_swizzel_lookup[uchar8( '0' )] = 0; 367 nlua_swizzel_lookup[uchar8( 'y' )] = 1; 368 nlua_swizzel_lookup[uchar8( 'g' )] = 1; 369 nlua_swizzel_lookup[uchar8( 't' )] = 0; 370 nlua_swizzel_lookup[uchar8( '1' )] = 1; 371 nlua_swizzel_lookup[uchar8( 'z' )] = 2; 372 nlua_swizzel_lookup[uchar8( 'b' )] = 2; 373 nlua_swizzel_lookup[uchar8( 'u' )] = 0; 374 nlua_swizzel_lookup[uchar8( '2' )] = 2; 375 nlua_swizzel_lookup[uchar8( 'w' )] = 3; 376 nlua_swizzel_lookup[uchar8( 'a' )] = 3; 377 nlua_swizzel_lookup[uchar8( 'v' )] = 0; 378 nlua_swizzel_lookup[uchar8( '3' )] = 3; 379 379 int stack = lua_gettop( L ); 380 380 -
trunk/src/lua/lua_map_tile.cc
r368 r369 20 20 struct map_tile 21 21 { 22 nv::uint8* data;23 nv:: char8* ascii;24 nv::uint16 size_x;25 nv::uint16 size_y;22 nv::uint8* data; 23 nv::uchar8* ascii; 24 nv::uint16 size_x; 25 nv::uint16 size_y; 26 26 }; 27 27 … … 66 66 } 67 67 tile.data = new nv::uint8[ tile.size_x * tile.size_y ]; 68 tile.ascii = ( ascii ? new nv:: char8[ tile.size_x * tile.size_y ] : nullptr );68 tile.ascii = ( ascii ? new nv::uchar8[ tile.size_x * tile.size_y ] : nullptr ); 69 69 70 70 nv::uint8 translation[256] = { 0 }; … … 89 89 for ( nv::uint16 row = 0; row < tile.size_y; row++ ) 90 90 { 91 nv:: char8 gylph = (nv::char8)code[ row * ( tile.size_x + 1 ) + line ];91 nv::uchar8 gylph = (nv::uchar8)code[ row * ( tile.size_x + 1 ) + line ]; 92 92 // TODO: check for errors 93 93 tile.data[ row * tile.size_x + line ] = translation[ gylph ]; … … 110 110 if ( old_tile->ascii ) 111 111 { 112 new_tile->ascii = new nv:: char8[ size ];112 new_tile->ascii = new nv::uchar8[ size ]; 113 113 } 114 114 std::copy( old_tile->data, old_tile->data + size, new_tile->data ); -
trunk/src/sdl/sdl_input.cc
r357 r369 30 30 if (ucode >= 32 && ucode < 128 ) 31 31 { 32 kevent.key.ascii = static_cast< char8>( ucode );32 kevent.key.ascii = static_cast<uchar8>( ucode ); 33 33 if (ucode >= 'a' && ucode <= 'z') 34 34 { … … 36 36 int capslock = !!(ke.keysym.mod & KMOD_CAPS); 37 37 if ((shifted ^ capslock) != 0) { 38 kevent.key.ascii = ( char8)SDL_toupper((int)ucode);38 kevent.key.ascii = (uchar8)SDL_toupper((int)ucode); 39 39 } 40 40 }
Note: See TracChangeset
for help on using the changeset viewer.