Rearrange code and make a faster sha256sum program

This commit is contained in:
Justine Tunney 2022-11-02 23:12:32 -07:00
parent 5e60e5ad10
commit 89d1e5b8f2
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
32 changed files with 933 additions and 517 deletions

View file

@ -19,14 +19,8 @@
#include "libc/intrin/lockxchg.h"
#include "libc/stdio/stdio.h"
/**
* Closes standard i/o stream and its underlying thing.
*
* @param f is the heap file object pointer, to close+free+clear
* @return 0 on success or -1 on error, which can be a trick for
* differentiating between EOF and real errors during previous
* i/o calls, without needing to call ferror()
*/
// TODO(jart): delete
int fclose_s(FILE **fp) {
FILE *f = NULL;
return fclose(lockxchg(fp, &f));