Brad Fitzpatrick (brad) wrote,
Brad Fitzpatrick

Who's the shit?
make_int_string (int ourInt, char *buffer, 
int buffersize, char **start, int *length)
int len = 1;
char *dig = &buffer[buffersize-1];
do {
*dig = (ourInt % 10) + '0';
ourInt /= 10;
if (ourInt) {
} while (ourInt);
*length = len;
*start = dig;
This is C code that gets to compiled to MIPS binaries, and then gets run on our project operating system.... the fragment above writes to a buffer the character representation of an integer, since we need it to output integers to the console/pipe/file ... heh ... this is fun. (Note to people that are good at C: don't mock my code ... I write Perl and SQL all day ... for me this is some high-quality stuff...... :-))
Tags: perl, tech

  • Ukraine

    Nobody reads my LiveJournal anymore, but thank you to everybody in Russia protesting Putin's insane war against Ukraine. (I know it's risky…

  • Happy Birthday!

    Happy 20th Birthday, LiveJournal! 🐐🎂🎉

  • hi

    Posting from the iPhone app. Maybe I'm unblocked now.

  • Post a new comment


    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.