fix nitpicks
This commit is contained in:
parent
a13f2271da
commit
21c7228038
4
lib/db.c
4
lib/db.c
|
@ -48,8 +48,8 @@ static uint32_t y16t_db_palloc2(void * context_)
|
|||
__attribute__((nonnull))
|
||||
static int y16t_db_intern_pgsearch(
|
||||
const int fd,
|
||||
off_t start_offset,
|
||||
uint8_t bufexp[],
|
||||
const off_t start_offset,
|
||||
const uint8_t bufexp[],
|
||||
uint32_t *i_
|
||||
) {
|
||||
uint8_t buf[4096] = {0};
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
// SPDX-License-Identifier: ISC
|
||||
#include "y16t_internal.h"
|
||||
// this file is directly included by idx.c
|
||||
// conversion between hilbert curve distance and x,y values
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
// rotate/flip a quadrant appropriately
|
||||
static void y16t_hilbert_rot(
|
||||
|
@ -23,7 +26,7 @@ static void y16t_hilbert_rot(
|
|||
}
|
||||
|
||||
__attribute__((pure))
|
||||
uint32_t y16t_hilbert_xy2d(uint32_t n, uint32_t x, uint32_t y) {
|
||||
static uint32_t y16t_hilbert_xy2d(uint32_t n, uint32_t x, uint32_t y) {
|
||||
uint32_t rx, ry, s, d=0;
|
||||
for (s=n/2; s>0; s/=2) {
|
||||
rx = (x & s) > 0;
|
||||
|
@ -34,7 +37,8 @@ uint32_t y16t_hilbert_xy2d(uint32_t n, uint32_t x, uint32_t y) {
|
|||
return d;
|
||||
}
|
||||
|
||||
void y16t_hilbert_d2xy(uint32_t n, uint32_t d, uint32_t *x, uint32_t *y) {
|
||||
/*
|
||||
static void y16t_hilbert_d2xy(uint32_t n, uint32_t d, uint32_t *x, uint32_t *y) {
|
||||
uint32_t rx, ry, s, t=d;
|
||||
*x = *y = 0;
|
||||
for (s=1; s<n; s*=2) {
|
||||
|
@ -46,3 +50,4 @@ void y16t_hilbert_d2xy(uint32_t n, uint32_t d, uint32_t *x, uint32_t *y) {
|
|||
t /= 4;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "hilbert.c"
|
||||
|
||||
static __attribute__((pure))
|
||||
uint32_t y16t_table_at(const y16t_idx_t idx, const uint8_t x, const uint8_t y)
|
||||
{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
install_headers('y16t_db.h', 'y16t_idx.h')
|
||||
|
||||
liby16t = shared_library('y16t',
|
||||
files('db.c', 'hilbert.c', 'idx.c', 'pall.c'),
|
||||
files('db.c', 'idx.c', 'pall.c'),
|
||||
version : '0.0.0',
|
||||
c_args : [c_base_args],
|
||||
include_directories : include_directories('.'),
|
||||
|
|
|
@ -3,13 +3,6 @@
|
|||
#include <sys/types.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
// conversion between hilbert curve distance and x,y values
|
||||
|
||||
__attribute__((pure))
|
||||
uint32_t y16t_hilbert_xy2d(uint32_t n, uint32_t x, uint32_t y);
|
||||
|
||||
void y16t_hilbert_d2xy(uint32_t n, uint32_t d, uint32_t *x, uint32_t *y);
|
||||
|
||||
// handling of resumption of pread/pwrite calls
|
||||
|
||||
ssize_t y16t_pread_all(int fd, void *buf, size_t nbyte, off_t offset);
|
||||
|
|
Loading…
Reference in a new issue