mirror of
https://git.code.sf.net/p/zint/code
synced 2025-12-21 11:57:04 +00:00
#209 large.c fix oversized arrays by 0-filling; const args, casts
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
/*
|
||||
libzint - the open source barcode library
|
||||
Copyright (C) 2008 - 2020 Robin Stuart <rstuart114@gmail.com>
|
||||
Copyright (C) 2008 - 2021 Robin Stuart <rstuart114@gmail.com>
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
@@ -54,24 +54,24 @@ typedef struct { uint64_t lo; uint64_t hi; } large_int;
|
||||
/* Set 128-bit `t` from 64-bit `s` */
|
||||
#define large_load_u64(t, s) do { (t)->lo = (s); (t)->hi = 0; } while (0)
|
||||
|
||||
INTERNAL void large_load_str_u64(large_int *t, const unsigned char *s, int length);
|
||||
INTERNAL void large_load_str_u64(large_int *t, const unsigned char *s, const int length);
|
||||
|
||||
INTERNAL void large_add(large_int *t, const large_int *s);
|
||||
INTERNAL void large_add_u64(large_int *t, uint64_t s);
|
||||
INTERNAL void large_add_u64(large_int *t, const uint64_t s);
|
||||
|
||||
INTERNAL void large_sub_u64(large_int *t, uint64_t s);
|
||||
INTERNAL void large_sub_u64(large_int *t, const uint64_t s);
|
||||
|
||||
INTERNAL void large_mul_u64(large_int *t, uint64_t s);
|
||||
INTERNAL void large_mul_u64(large_int *t, const uint64_t s);
|
||||
|
||||
INTERNAL uint64_t large_div_u64(large_int *t, uint64_t v);
|
||||
|
||||
INTERNAL void large_unset_bit(large_int *t, int bit);
|
||||
INTERNAL void large_unset_bit(large_int *t, const int bit);
|
||||
|
||||
INTERNAL void large_uint_array(const large_int *t, unsigned int *uint_array, int size, int bits);
|
||||
INTERNAL void large_uchar_array(const large_int *t, unsigned char *uchar_array, int size, int bits);
|
||||
INTERNAL void large_uint_array(const large_int *t, unsigned int *uint_array, const int size, int bits);
|
||||
INTERNAL void large_uchar_array(const large_int *t, unsigned char *uchar_array, const int size, int bits);
|
||||
|
||||
INTERNAL void large_print(large_int *t);
|
||||
INTERNAL char *large_dump(large_int *t, char *buf);
|
||||
INTERNAL void large_print(const large_int *t);
|
||||
INTERNAL char *large_dump(const large_int *t, char *buf);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user