mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-21 08:47:28 +01:00
Re-order cgen/base-impl.h methods for consistency.
This commit is contained in:
1 parent
2335024d43
commit
587be36759
4 files changed
+65
-65
No files matched your search
+21
-21
@@ -449,27 +449,6 @@ static inline uint64_t puffs_base_slice_u8_copy_from_slice(
|
||||
return n;
|
||||
}
|
||||
|
||||
static inline uint32_t puffs_base_writer1_copy_from_reader32(uint8_t** ptr_wptr,
|
||||
uint8_t* wend,
|
||||
uint8_t** ptr_rptr,
|
||||
uint8_t* rend,
|
||||
uint32_t length) {
|
||||
uint8_t* wptr = *ptr_wptr;
|
||||
if (length > (wend - wptr)) {
|
||||
length = wend - wptr;
|
||||
}
|
||||
uint8_t* rptr = *ptr_rptr;
|
||||
if (length > (rend - rptr)) {
|
||||
length = rend - rptr;
|
||||
}
|
||||
if (length > 0) {
|
||||
memmove(wptr, rptr, length);
|
||||
*ptr_wptr += length;
|
||||
*ptr_rptr += length;
|
||||
}
|
||||
return length;
|
||||
}
|
||||
|
||||
static inline uint32_t puffs_base_writer1_copy_from_history32(uint8_t** ptr_ptr,
|
||||
uint8_t* start,
|
||||
uint8_t* end,
|
||||
@@ -505,6 +484,27 @@ static inline uint32_t puffs_base_writer1_copy_from_history32(uint8_t** ptr_ptr,
|
||||
return length;
|
||||
}
|
||||
|
||||
static inline uint32_t puffs_base_writer1_copy_from_reader32(uint8_t** ptr_wptr,
|
||||
uint8_t* wend,
|
||||
uint8_t** ptr_rptr,
|
||||
uint8_t* rend,
|
||||
uint32_t length) {
|
||||
uint8_t* wptr = *ptr_wptr;
|
||||
if (length > (wend - wptr)) {
|
||||
length = wend - wptr;
|
||||
}
|
||||
uint8_t* rptr = *ptr_rptr;
|
||||
if (length > (rend - rptr)) {
|
||||
length = rend - rptr;
|
||||
}
|
||||
if (length > 0) {
|
||||
memmove(wptr, rptr, length);
|
||||
*ptr_wptr += length;
|
||||
*ptr_rptr += length;
|
||||
}
|
||||
return length;
|
||||
}
|
||||
|
||||
#endif // PUFFS_BASE_IMPL_H
|
||||
|
||||
// ---------------- Status Codes Implementations
|
||||
|
||||
+21
-21
@@ -416,27 +416,6 @@ static inline uint64_t puffs_base_slice_u8_copy_from_slice(
|
||||
return n;
|
||||
}
|
||||
|
||||
static inline uint32_t puffs_base_writer1_copy_from_reader32(uint8_t** ptr_wptr,
|
||||
uint8_t* wend,
|
||||
uint8_t** ptr_rptr,
|
||||
uint8_t* rend,
|
||||
uint32_t length) {
|
||||
uint8_t* wptr = *ptr_wptr;
|
||||
if (length > (wend - wptr)) {
|
||||
length = wend - wptr;
|
||||
}
|
||||
uint8_t* rptr = *ptr_rptr;
|
||||
if (length > (rend - rptr)) {
|
||||
length = rend - rptr;
|
||||
}
|
||||
if (length > 0) {
|
||||
memmove(wptr, rptr, length);
|
||||
*ptr_wptr += length;
|
||||
*ptr_rptr += length;
|
||||
}
|
||||
return length;
|
||||
}
|
||||
|
||||
static inline uint32_t puffs_base_writer1_copy_from_history32(uint8_t** ptr_ptr,
|
||||
uint8_t* start,
|
||||
uint8_t* end,
|
||||
@@ -472,6 +451,27 @@ static inline uint32_t puffs_base_writer1_copy_from_history32(uint8_t** ptr_ptr,
|
||||
return length;
|
||||
}
|
||||
|
||||
static inline uint32_t puffs_base_writer1_copy_from_reader32(uint8_t** ptr_wptr,
|
||||
uint8_t* wend,
|
||||
uint8_t** ptr_rptr,
|
||||
uint8_t* rend,
|
||||
uint32_t length) {
|
||||
uint8_t* wptr = *ptr_wptr;
|
||||
if (length > (wend - wptr)) {
|
||||
length = wend - wptr;
|
||||
}
|
||||
uint8_t* rptr = *ptr_rptr;
|
||||
if (length > (rend - rptr)) {
|
||||
length = rend - rptr;
|
||||
}
|
||||
if (length > 0) {
|
||||
memmove(wptr, rptr, length);
|
||||
*ptr_wptr += length;
|
||||
*ptr_rptr += length;
|
||||
}
|
||||
return length;
|
||||
}
|
||||
|
||||
#endif // PUFFS_BASE_IMPL_H
|
||||
|
||||
// ---------------- Status Codes Implementations
|
||||
|
||||
Reference in new issue
Block a user