Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

printf is too verbose and retarded of a name

Name: Anonymous 2021-03-09 11:00

Hey queers! Here is a proper replacement for printf called shit()

#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdarg.h>

void hidden_shit(uint64_t a0, ...) {
va_list ap;
uint64_t type = a0;
va_start(ap, a0);
type = va_arg(ap, uint64_t);
for (int i = 0; type; i++) {
if (type > 32) {
printf("%s", (char*)type);
type = va_arg(ap, uint64_t);
continue;
}
if (type == 1) {
printf("%lld", va_arg(ap, uint64_t));
} else if (type == 2) {
printf("%llx", va_arg(ap, uint64_t));
} else if (type == 3) {
printf("%f", va_arg(ap, double));
} else if (type == 4) {
printf("%p", (void*)va_arg(ap, uint64_t));
}
type = va_arg(ap, uint64_t);
}
printf("\n");
va_end(ap);
}

#define shit(...) \
do { \
uint64_t S=1, X=2, F=3, P=4; \
hidden_shit((uint64_t)0,__VA_ARGS__,(uint64_t)0);\
} while(0)


int main() {
int a = 123, b = 456, c = 666;
shit("hello world!");
shit("c=",S,c);
shit(S,a,",",F,456.0,",",X,b,",done");
char *verb = "go fuck", *object = "yourself", *adjective = "dumbfuck";
shit(verb," ",object,", ",adjective);
return 0;
}

Name: Anonymous 2021-03-11 11:17

>>5
//NashC language main header file

#ifndef NSHC_H
#define NSHC_H

#include <stdint.h>
#include <stdlib.h>
#include <string.h>

@nc

#include "nsh/typedef.h"

#define NSH_NO_SWAP
#include "pp/defs.h"
#undef NSH_NO_SWAP

#define SWAP(x,y) do {auto t_ = x; x = y; y = t_;} while(0)


//#define LIKELY(x) (x)
//#define UNLIKELY(x) (x)

#include "nshc/clamp.h"

#define new(type) ((type*)malloc(sizeof(type))).ctor

#define delete(o) free((o).dtor)

#include "nshc/tlist.h"

#include "nshc/cat.h"

@end
#endif

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List