mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-19 08:38:14 +01:00
Make wuffs_base__flicks a *signed* integer type
This commit is contained in:
1 parent
6df342c60c
commit
0413c52e19
18 files changed
+21
-18
No files matched your search
@@ -49,7 +49,7 @@ typedef struct {
|
||||
|
||||
// Flicks are a unit of time. One flick (frame-tick) is 1 / 705_600_000 of a
|
||||
// second. See https://github.com/OculusVR/Flicks
|
||||
typedef uint64_t wuffs_base__flicks;
|
||||
typedef int64_t wuffs_base__flicks;
|
||||
|
||||
#define WUFFS_BASE__FLICKS_PER_SECOND ((uint64_t)705600000)
|
||||
#define WUFFS_BASE__FLICKS_PER_MILLISECOND ((uint64_t)705600)
|
||||
|
||||
@@ -20,7 +20,7 @@ const baseHeader = "" +
|
||||
"#ifndef WUFFS_BASE_HEADER_H\n#define WUFFS_BASE_HEADER_H\n\n// Copyright 2017 The Wuffs Authors.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <stdbool.h>\n#include <stdint.h>\n#include <string.h>\n\n// Wuffs assumes that:\n// - converting a uint32_t to a size_t will never overflow.\n// - converting a size_t to a uint64_t will never overflow.\n#if (__WORDSIZE != 32) && (__WORDSIZE != 64)\n#error \"Wuffs requires a word size of either 32 or 64 bits\"\n#endif\n\n// WUFFS_VERSION is the major.minor version number " +
|
||||
"as a uint32_t. 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 WUFFS_VERSION ((uint32_t)0x00001)\n\n// wuffs_base__empty_struct is used when a Wuffs function returns an empty\n// struct. In C, if a function f returns void, you can't say \"x = f()\", but in\n// Wuffs, if a function g returns empty, you can say \"y = g()\".\ntypedef struct {\n} wuffs_base__empty_struct;\n\n" +
|
||||
"" +
|
||||
"// ---------------- Numeric Types\n\n// Flicks are a unit of time. One flick (frame-tick) is 1 / 705_600_000 of a\n// second. See https://github.com/OculusVR/Flicks\ntypedef uint64_t wuffs_base__flicks;\n\n#define WUFFS_BASE__FLICKS_PER_SECOND ((uint64_t)705600000)\n#define WUFFS_BASE__FLICKS_PER_MILLISECOND ((uint64_t)705600)\n\n" +
|
||||
"// ---------------- Numeric Types\n\n// Flicks are a unit of time. One flick (frame-tick) is 1 / 705_600_000 of a\n// second. See https://github.com/OculusVR/Flicks\ntypedef int64_t wuffs_base__flicks;\n\n#define WUFFS_BASE__FLICKS_PER_SECOND ((uint64_t)705600000)\n#define WUFFS_BASE__FLICKS_PER_MILLISECOND ((uint64_t)705600)\n\n" +
|
||||
"" +
|
||||
"// --------\n\nstatic inline uint8_t wuffs_base__u8__min(uint8_t x, uint8_t y) {\n return x < y ? x : y;\n}\n\nstatic inline uint8_t wuffs_base__u8__max(uint8_t x, uint8_t y) {\n return x > y ? x : y;\n}\n\nstatic inline uint16_t wuffs_base__u16__min(uint16_t x, uint16_t y) {\n return x < y ? x : y;\n}\n\nstatic inline uint16_t wuffs_base__u16__max(uint16_t x, uint16_t y) {\n return x > y ? x : y;\n}\n\nstatic inline uint32_t wuffs_base__u32__min(uint32_t x, uint32_t y) {\n return x < y ? x : y;\n}\n\nstatic inline uint32_t wuffs_base__u32__max(uint32_t x, uint32_t y) {\n return x > y ? x : y;\n}\n\nstatic inline uint64_t wuffs_base__u64__min(uint64_t x, uint64_t y) {\n return x < y ? x : y;\n}\n\nstatic inline uint64_t wuffs_base__u64__max(uint64_t x, uint64_t y) {\n return x > y ? x : y;\n}\n\n" +
|
||||
"" +
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ typedef struct {
|
||||
|
||||
// Flicks are a unit of time. One flick (frame-tick) is 1 / 705_600_000 of a
|
||||
// second. See https://github.com/OculusVR/Flicks
|
||||
typedef uint64_t wuffs_base__flicks;
|
||||
typedef int64_t wuffs_base__flicks;
|
||||
|
||||
#define WUFFS_BASE__FLICKS_PER_SECOND ((uint64_t)705600000)
|
||||
#define WUFFS_BASE__FLICKS_PER_MILLISECOND ((uint64_t)705600)
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ typedef struct {
|
||||
|
||||
// Flicks are a unit of time. One flick (frame-tick) is 1 / 705_600_000 of a
|
||||
// second. See https://github.com/OculusVR/Flicks
|
||||
typedef uint64_t wuffs_base__flicks;
|
||||
typedef int64_t wuffs_base__flicks;
|
||||
|
||||
#define WUFFS_BASE__FLICKS_PER_SECOND ((uint64_t)705600000)
|
||||
#define WUFFS_BASE__FLICKS_PER_MILLISECOND ((uint64_t)705600)
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ typedef struct {
|
||||
|
||||
// Flicks are a unit of time. One flick (frame-tick) is 1 / 705_600_000 of a
|
||||
// second. See https://github.com/OculusVR/Flicks
|
||||
typedef uint64_t wuffs_base__flicks;
|
||||
typedef int64_t wuffs_base__flicks;
|
||||
|
||||
#define WUFFS_BASE__FLICKS_PER_SECOND ((uint64_t)705600000)
|
||||
#define WUFFS_BASE__FLICKS_PER_MILLISECOND ((uint64_t)705600)
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ typedef struct {
|
||||
|
||||
// Flicks are a unit of time. One flick (frame-tick) is 1 / 705_600_000 of a
|
||||
// second. See https://github.com/OculusVR/Flicks
|
||||
typedef uint64_t wuffs_base__flicks;
|
||||
typedef int64_t wuffs_base__flicks;
|
||||
|
||||
#define WUFFS_BASE__FLICKS_PER_SECOND ((uint64_t)705600000)
|
||||
#define WUFFS_BASE__FLICKS_PER_MILLISECOND ((uint64_t)705600)
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ typedef struct {
|
||||
|
||||
// Flicks are a unit of time. One flick (frame-tick) is 1 / 705_600_000 of a
|
||||
// second. See https://github.com/OculusVR/Flicks
|
||||
typedef uint64_t wuffs_base__flicks;
|
||||
typedef int64_t wuffs_base__flicks;
|
||||
|
||||
#define WUFFS_BASE__FLICKS_PER_SECOND ((uint64_t)705600000)
|
||||
#define WUFFS_BASE__FLICKS_PER_MILLISECOND ((uint64_t)705600)
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ typedef struct {
|
||||
|
||||
// Flicks are a unit of time. One flick (frame-tick) is 1 / 705_600_000 of a
|
||||
// second. See https://github.com/OculusVR/Flicks
|
||||
typedef uint64_t wuffs_base__flicks;
|
||||
typedef int64_t wuffs_base__flicks;
|
||||
|
||||
#define WUFFS_BASE__FLICKS_PER_SECOND ((uint64_t)705600000)
|
||||
#define WUFFS_BASE__FLICKS_PER_MILLISECOND ((uint64_t)705600)
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ typedef struct {
|
||||
|
||||
// Flicks are a unit of time. One flick (frame-tick) is 1 / 705_600_000 of a
|
||||
// second. See https://github.com/OculusVR/Flicks
|
||||
typedef uint64_t wuffs_base__flicks;
|
||||
typedef int64_t wuffs_base__flicks;
|
||||
|
||||
#define WUFFS_BASE__FLICKS_PER_SECOND ((uint64_t)705600000)
|
||||
#define WUFFS_BASE__FLICKS_PER_MILLISECOND ((uint64_t)705600)
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ typedef struct {
|
||||
|
||||
// Flicks are a unit of time. One flick (frame-tick) is 1 / 705_600_000 of a
|
||||
// second. See https://github.com/OculusVR/Flicks
|
||||
typedef uint64_t wuffs_base__flicks;
|
||||
typedef int64_t wuffs_base__flicks;
|
||||
|
||||
#define WUFFS_BASE__FLICKS_PER_SECOND ((uint64_t)705600000)
|
||||
#define WUFFS_BASE__FLICKS_PER_MILLISECOND ((uint64_t)705600)
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ typedef struct {
|
||||
|
||||
// Flicks are a unit of time. One flick (frame-tick) is 1 / 705_600_000 of a
|
||||
// second. See https://github.com/OculusVR/Flicks
|
||||
typedef uint64_t wuffs_base__flicks;
|
||||
typedef int64_t wuffs_base__flicks;
|
||||
|
||||
#define WUFFS_BASE__FLICKS_PER_SECOND ((uint64_t)705600000)
|
||||
#define WUFFS_BASE__FLICKS_PER_MILLISECOND ((uint64_t)705600)
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ typedef struct {
|
||||
|
||||
// Flicks are a unit of time. One flick (frame-tick) is 1 / 705_600_000 of a
|
||||
// second. See https://github.com/OculusVR/Flicks
|
||||
typedef uint64_t wuffs_base__flicks;
|
||||
typedef int64_t wuffs_base__flicks;
|
||||
|
||||
#define WUFFS_BASE__FLICKS_PER_SECOND ((uint64_t)705600000)
|
||||
#define WUFFS_BASE__FLICKS_PER_MILLISECOND ((uint64_t)705600)
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ typedef struct {
|
||||
|
||||
// Flicks are a unit of time. One flick (frame-tick) is 1 / 705_600_000 of a
|
||||
// second. See https://github.com/OculusVR/Flicks
|
||||
typedef uint64_t wuffs_base__flicks;
|
||||
typedef int64_t wuffs_base__flicks;
|
||||
|
||||
#define WUFFS_BASE__FLICKS_PER_SECOND ((uint64_t)705600000)
|
||||
#define WUFFS_BASE__FLICKS_PER_MILLISECOND ((uint64_t)705600)
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ typedef struct {
|
||||
|
||||
// Flicks are a unit of time. One flick (frame-tick) is 1 / 705_600_000 of a
|
||||
// second. See https://github.com/OculusVR/Flicks
|
||||
typedef uint64_t wuffs_base__flicks;
|
||||
typedef int64_t wuffs_base__flicks;
|
||||
|
||||
#define WUFFS_BASE__FLICKS_PER_SECOND ((uint64_t)705600000)
|
||||
#define WUFFS_BASE__FLICKS_PER_MILLISECOND ((uint64_t)705600)
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ typedef struct {
|
||||
|
||||
// Flicks are a unit of time. One flick (frame-tick) is 1 / 705_600_000 of a
|
||||
// second. See https://github.com/OculusVR/Flicks
|
||||
typedef uint64_t wuffs_base__flicks;
|
||||
typedef int64_t wuffs_base__flicks;
|
||||
|
||||
#define WUFFS_BASE__FLICKS_PER_SECOND ((uint64_t)705600000)
|
||||
#define WUFFS_BASE__FLICKS_PER_MILLISECOND ((uint64_t)705600)
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ typedef struct {
|
||||
|
||||
// Flicks are a unit of time. One flick (frame-tick) is 1 / 705_600_000 of a
|
||||
// second. See https://github.com/OculusVR/Flicks
|
||||
typedef uint64_t wuffs_base__flicks;
|
||||
typedef int64_t wuffs_base__flicks;
|
||||
|
||||
#define WUFFS_BASE__FLICKS_PER_SECOND ((uint64_t)705600000)
|
||||
#define WUFFS_BASE__FLICKS_PER_MILLISECOND ((uint64_t)705600)
|
||||
|
||||
@@ -123,7 +123,9 @@ var Funcs = []string{
|
||||
// ---- image_buffer
|
||||
|
||||
"image_buffer.plane(p u32[..3])(ret table u8)",
|
||||
"image_buffer.update!(dirty_rect rect_ie_u32, duration u64, blend bool, disposal u8, palette slice u8)()",
|
||||
// Duration's upper bound is the maximum possible i64 value.
|
||||
"image_buffer.update!(dirty_rect rect_ie_u32, duration u64[..0xFFFFFFFFFFFFFFF], " +
|
||||
"blend bool, disposal u8, palette slice u8)()",
|
||||
|
||||
// ---- image_config
|
||||
|
||||
|
||||
@@ -61,7 +61,8 @@ pub struct decoder?(
|
||||
gc_has_transparent_index base.bool,
|
||||
gc_transparent_index base.u8,
|
||||
gc_disposal base.u8,
|
||||
gc_duration base.u64,
|
||||
// There are 7056000 flicks per centisecond.
|
||||
gc_duration base.u64[..0xFFFF * 7056000],
|
||||
|
||||
frame_rect base.rect_ie_u32,
|
||||
|
||||
|
||||
Reference in new issue
Block a user