mirror of
https://github.com/thepigeongenerator/mcaselector-lite.git
synced 2025-12-18 20:35:45 +01:00
Compare commits
2 Commits
8861e591f6
...
d1d5e14971
| Author | SHA1 | Date | |
|---|---|---|---|
| d1d5e14971 | |||
| bcf7c9be60 |
@@ -39,13 +39,8 @@ Where \*.mca files are the newer variant.
|
|||||||
|
|
||||||
### coordinate conversions
|
### coordinate conversions
|
||||||
```c
|
```c
|
||||||
// block->chunk:
|
return (x >> 4); // block->chunk
|
||||||
return (x / 16) - sgn(x);
|
return (x >> 5); // chunk->region
|
||||||
return (x >> 4) - (x & 0x80000000);
|
|
||||||
|
|
||||||
// chunk->region:
|
|
||||||
return (x / 32) - sgn(x);
|
|
||||||
return (x >> 5) - (x & 0x80000000);
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,10 +2,12 @@
|
|||||||
|
|
||||||
#include "../src/util/conf.h"
|
#include "../src/util/conf.h"
|
||||||
#include "../src/util/types.h"
|
#include "../src/util/types.h"
|
||||||
|
#include "t_arith.h"
|
||||||
#include "t_conf.h"
|
#include "t_conf.h"
|
||||||
#include "test.h"
|
#include "test.h"
|
||||||
|
|
||||||
testdat tests[] = {
|
testdat tests[] = {
|
||||||
|
{"ensure SAR", test_sar, NULL },
|
||||||
{"k=v", test_procbuf, &(struct test_procbuf){"key=val", "key", "val", 0} },
|
{"k=v", test_procbuf, &(struct test_procbuf){"key=val", "key", "val", 0} },
|
||||||
{"sometxt", test_procbuf, &(struct test_procbuf){"sometxt", "sometxt", "", CONF_ESYNTAX} },
|
{"sometxt", test_procbuf, &(struct test_procbuf){"sometxt", "sometxt", "", CONF_ESYNTAX} },
|
||||||
{"comment", test_procbuf, &(struct test_procbuf){"# comment", "", "", CONF_ENODAT} },
|
{"comment", test_procbuf, &(struct test_procbuf){"# comment", "", "", CONF_ENODAT} },
|
||||||
|
|||||||
8
test/t_arith.h
Normal file
8
test/t_arith.h
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "test.h"
|
||||||
|
|
||||||
|
int test_sar(void *dat) {
|
||||||
|
(void)dat;
|
||||||
|
return assert_true(-3 >> 5 == -1);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user