diff --git a/cmd/puffs-gen-c/base-header.h b/cmd/puffs-gen-c/base-header.h index 4f3d9300..18b2c446 100644 --- a/cmd/puffs-gen-c/base-header.h +++ b/cmd/puffs-gen-c/base-header.h @@ -23,8 +23,6 @@ #error "Puffs requires a word size of at most 64 bits" #endif -// Simil - // PUFFS_VERSION is the major.minor version number as a uint32. The major // number is the high 16 bits. The minor number is the low 16 bits. // diff --git a/cmd/puffs-gen-c/data.go b/cmd/puffs-gen-c/data.go index 00a3160e..587b0672 100644 --- a/cmd/puffs-gen-c/data.go +++ b/cmd/puffs-gen-c/data.go @@ -6,8 +6,8 @@ package main const baseHeader = "" + - "#ifndef PUFFS_BASE_HEADER_H\n#define PUFFS_BASE_HEADER_H\n\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 \n#include \n#include \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//\n// Similarly, the word size is at most 64 bits because it assumes that\n// converting a usize to u64 will never overflow.\n#if __WORDSIZE < 32\n#error \"Puffs requires a word size of at least 32 bits\"\n#elif __WORDSIZE > 64\n#error \"Puffs requires a word size of at most 64 bits\"\n#endif\n\n// Simil\n\n// PUFFS_VERSION is the major.minor version number as a uint32. The major\n// number is the high 16 bits. The minor number is the low 16 bits.\n//\n// The intention is to bump the version number at least on " + - "every API / ABI\n// backwards incompatible change.\n//\n// For now, the API and ABI are simply unstable and can change at any time.\n//\n// TODO: don't hard code this in base-header.h.\n#define PUFFS_VERSION (0x00001)\n\n// puffs_base_buf1 is a 1-dimensional buffer (a pointer and length) plus\n// additional indexes into that buffer.\n//\n// A value with all fields NULL or zero is a valid, empty buffer.\ntypedef struct {\n uint8_t* ptr; // Pointer.\n size_t len; // Length.\n size_t wi; // Write index. Invariant: wi <= len.\n size_t ri; // Read index. Invariant: ri <= wi.\n bool closed; // No further writes are expected.\n} puffs_base_buf1;\n\n#endif // PUFFS_BASE_HEADER_H\n" + + "#ifndef PUFFS_BASE_HEADER_H\n#define PUFFS_BASE_HEADER_H\n\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 \n#include \n#include \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//\n// Similarly, the word size is at most 64 bits because it assumes that\n// converting a usize to u64 will never overflow.\n#if __WORDSIZE < 32\n#error \"Puffs requires a word size of at least 32 bits\"\n#elif __WORDSIZE > 64\n#error \"Puffs requires a word size of at most 64 bits\"\n#endif\n\n// PUFFS_VERSION is the major.minor version number as a uint32. The major\n// number is the high 16 bits. The minor number is the low 16 bits.\n//\n// The intention is to bump the version number at least on every API " + + "/ ABI\n// backwards incompatible change.\n//\n// For now, the API and ABI are simply unstable and can change at any time.\n//\n// TODO: don't hard code this in base-header.h.\n#define PUFFS_VERSION (0x00001)\n\n// puffs_base_buf1 is a 1-dimensional buffer (a pointer and length) plus\n// additional indexes into that buffer.\n//\n// A value with all fields NULL or zero is a valid, empty buffer.\ntypedef struct {\n uint8_t* ptr; // Pointer.\n size_t len; // Length.\n size_t wi; // Write index. Invariant: wi <= len.\n size_t ri; // Read index. Invariant: ri <= wi.\n bool closed; // No further writes are expected.\n} puffs_base_buf1;\n\n#endif // PUFFS_BASE_HEADER_H\n" + "" const baseImpl = "" + diff --git a/gen/c/std/gif.c b/gen/c/std/gif.c index a75d274e..b234c452 100644 --- a/gen/c/std/gif.c +++ b/gen/c/std/gif.c @@ -26,8 +26,6 @@ #error "Puffs requires a word size of at most 64 bits" #endif -// Simil - // PUFFS_VERSION is the major.minor version number as a uint32. The major // number is the high 16 bits. The minor number is the low 16 bits. // diff --git a/gen/h/std/gif.h b/gen/h/std/gif.h index 5ba75973..f3447892 100644 --- a/gen/h/std/gif.h +++ b/gen/h/std/gif.h @@ -26,8 +26,6 @@ #error "Puffs requires a word size of at most 64 bits" #endif -// Simil - // PUFFS_VERSION is the major.minor version number as a uint32. The major // number is the high 16 bits. The minor number is the low 16 bits. //