summaryrefslogtreecommitdiff
path: root/src/user/app/iochk/iochk.c
diff options
context:
space:
mode:
authordzwdz2023-01-25 20:16:22 +0100
committerdzwdz2023-01-25 20:16:22 +0100
commit17bfb0ef0a48330b1d54e61fe3c30d83528d2d90 (patch)
treeb3d4aed1f408edcb17fe5c86fccaeacaa2a5a48a /src/user/app/iochk/iochk.c
parent2ad6ee8ed15d1bf898645a16dbc06991a3c1425e (diff)
style: typedef structs, shorter namespaces
I've wanted to do this for a while, and since I've just had a relatively large refactor commit (pcpy), this is as good of a time as any. Typedefing structs was mostly inspired by Plan 9's coding style. It makes some lines of code much shorter at basically no expense. Everything related to userland kept old-style struct definitions, so as not to force that style onto other people. I also considered changing SCREAMING_ENUM_FIELDS to NicerLookingCamelcase, but I didn't, just in case that'd be confusing.
Diffstat (limited to 'src/user/app/iochk/iochk.c')
-rw-r--r--src/user/app/iochk/iochk.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/user/app/iochk/iochk.c b/src/user/app/iochk/iochk.c
index e4b0346..9703919 100644
--- a/src/user/app/iochk/iochk.c
+++ b/src/user/app/iochk/iochk.c
@@ -13,7 +13,7 @@ static bool verbose = false;
#define eprintf(fmt, ...) fprintf(stderr, "iochk: "fmt"\n" __VA_OPT__(,) __VA_ARGS__)
-void check(handle_t h) {
+void check(hid_t h) {
const size_t buflen = 4096;
const size_t offsets[] = {
0, 1, 2, 3, 4, 5, 6, 7,
@@ -28,7 +28,7 @@ void check(handle_t h) {
}
long offlast = 0;
- long retlast = _syscall_read(h, buflast, buflen, offlast);
+ long retlast = _sys_read(h, buflast, buflen, offlast);
if (retlast < 0) {
eprintf("error %d when reading at offset %d", retlast, offlast);
goto end;
@@ -41,7 +41,7 @@ void check(handle_t h) {
assert(diff >= 0);
if (retlast < diff) break;
- long retcur = _syscall_read(h, bufcur, buflen, offcur);
+ long retcur = _sys_read(h, bufcur, buflen, offcur);
if (retcur < 0) {
eprintf("error %d when reading at offset %d", retlast, offcur);
break;
@@ -85,7 +85,7 @@ int main(int argc, char **argv) {
for (; optind < argc; optind++) {
const char *path = argv[optind];
verbosef("checking %s...\n", path);
- handle_t h = camellia_open(path, OPEN_READ);
+ hid_t h = camellia_open(path, OPEN_READ);
if (h < 0) {
eprintf("couldn't open %s", path);
continue;