If you make your variable names short enough, you can just make them an all-lowercase string [a-z0-9]+ and not worry about CamelCase or underscores or minuses

If you name your variables things like x, y, c, i, eu, ev, gorp, then you don't have to worry about CamelCase

eu, ev, and gorp are from actual code (not written my me!), by the way

@wallhackio UNIXv7, /usr/src/cmd/size.c:

#include    <stdio.h>
#include <a.out.h>

/*
size -- determine object size

*/

int a_magic[] = {A_MAGIC1,A_MAGIC2,A_MAGIC3,A_MAGIC4,0};

main(argc, argv)
char **argv;
{
struct exec buf;
long sum;
int gorp,i;
FILE *f;

if (argc==1) {
*argv = "a.out";
argc++;
--argv;
}
gorp = argc;
while(--argc) {
++argv;
if ((f = fopen(*argv, "r"))==NULL) {
printf("size: %s not found\n", *argv);
continue;
}
fread((char *)&buf, sizeof(buf), 1, f);
for(i=0;a_magic[i];i++)
if(a_magic[i] == buf.a_magic) break;
if(a_magic[i] == 0) {
printf("size: %s not an object file\n", *argv);
fclose(f);
continue;
}
if (gorp>2)
printf("%s: ", *argv);
printf("%u+%u+%u = ", buf.a_text,buf.a_data,buf.a_bss);
sum = (long) buf.a_text + (long) buf.a_data + (long) buf.a_bss;
printf("%Db = 0%Ob\n", sum, sum);
fclose(f);
}
}

@wallhackio They're saving the original value of argc in gorp before processing the arguments. No idea why they named it gorp.

@vaporeon_ im trying to think of a silly acronym but i cannot think of one, gorp is too weird

Sign in to participate in the conversation
📟🐱 GlitchCat

A small, community‐oriented Mastodon‐compatible Fediverse (GlitchSoc) instance managed as a joint venture between the cat and KIBI families.