mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-21 16:47:28 +01:00
Add comments about the minimum __WORDSIZE.
This commit is contained in:
1 parent
d7403b8e57
commit
371abbde2e
4 files changed
+13
-1
No files matched your search
@@ -6,5 +6,5 @@
|
|||||||
package cgen
|
package cgen
|
||||||
|
|
||||||
const preamble = "" +
|
const preamble = "" +
|
||||||
"// Use of this source code is governed by a BSD-style license that can be found\n// in the LICENSE file.\n\n#include <stdbool.h>\n#include <stdint.h>\n\n#if __WORDSIZE < 32\n#error \"Puffs requires a word size of at least 32 bits\"\n#endif\n" +
|
"// Use of this source code is governed by a BSD-style license that can be found\n// in the LICENSE file.\n\n#include <stdbool.h>\n#include <stdint.h>\n\n// Puffs requires a word size of at least 32 bits because it assumes that\n// converting a u32 to usize will never overflow. For example, the size of a\n// decoded image is often represented, explicitly or implicitly in an image\n// file, as a u32, and it is convenient to compare that to a buffer size.\n#if __WORDSIZE < 32\n#error \"Puffs requires a word size of at least 32 bits\"\n#endif\n" +
|
||||||
""
|
""
|
||||||
@@ -6,6 +6,10 @@
|
|||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
// Puffs requires a word size of at least 32 bits because it assumes that
|
||||||
|
// converting a u32 to usize will never overflow. For example, the size of a
|
||||||
|
// decoded image is often represented, explicitly or implicitly in an image
|
||||||
|
// file, as a u32, and it is convenient to compare that to a buffer size.
|
||||||
#if __WORDSIZE < 32
|
#if __WORDSIZE < 32
|
||||||
#error "Puffs requires a word size of at least 32 bits"
|
#error "Puffs requires a word size of at least 32 bits"
|
||||||
#endif
|
#endif
|
||||||
@@ -6,6 +6,10 @@
|
|||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
// Puffs requires a word size of at least 32 bits because it assumes that
|
||||||
|
// converting a u32 to usize will never overflow. For example, the size of a
|
||||||
|
// decoded image is often represented, explicitly or implicitly in an image
|
||||||
|
// file, as a u32, and it is convenient to compare that to a buffer size.
|
||||||
#if __WORDSIZE < 32
|
#if __WORDSIZE < 32
|
||||||
#error "Puffs requires a word size of at least 32 bits"
|
#error "Puffs requires a word size of at least 32 bits"
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -6,6 +6,10 @@
|
|||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
// Puffs requires a word size of at least 32 bits because it assumes that
|
||||||
|
// converting a u32 to usize will never overflow. For example, the size of a
|
||||||
|
// decoded image is often represented, explicitly or implicitly in an image
|
||||||
|
// file, as a u32, and it is convenient to compare that to a buffer size.
|
||||||
#if __WORDSIZE < 32
|
#if __WORDSIZE < 32
|
||||||
#error "Puffs requires a word size of at least 32 bits"
|
#error "Puffs requires a word size of at least 32 bits"
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in new issue
Block a user