lordpil's blog

youre watching hidden fortress?

Posted by renesis at 20:00 | permalink | 0 comments

hmm yeah something wrong
anyway i think i can prob figure it out now
should sleep first

Posted by renesis at 19:30 | permalink | 0 comments

i terminates with 0 when i comment out the free lines!
clearly free() is the problem and i shouldnt use it

Posted by renesis at 19:24 | permalink | 0 comments

nope it jumped to return 0, now its sitting at the free line
yeah dies at free line
im swapping them see if it dies on the other free
Warning: empty x range [0:0], adjusting to [-1:1]
Warning: empty y range [0:0], adjusting to [-1:1]
thats weird, in terminal
yeah breaks on either free
yeah i put int i = 0; after makePlot(), and it executes that fine, then dies on the next free() line

Posted by renesis at 19:19 | permalink | 0 comments

it returns an int and i dont assign that to anything because im being lazy
besides that im sure the code works
oh it dies before then
i put plotExample();, i know that works

Posted by renesis at 19:12 | permalink | 0 comments

i never malloc anything in there
env.sample free is in main
debugger say it crashes at the first free
and a png file gets made
envSeg is an array of structures, its allocated in makeEnv

Posted by renesis at 19:05 | permalink | 0 comments

it just takes a really long time to step im all tapping the step key
yeah it dies at free EnvSeg
line 34 gets killed on line 26

Posted by renesis at 19:00 | permalink | 0 comments

free((void *)envSeg);
free((void *)env.sample);
i dont get why that doesnt work
oh i thought it was in a micro instruction step mode

Posted by renesis at 18:55 | permalink | 0 comments

naw kernel builds would fuck up unless you made clean most the time
if you just changed one or two options in the config, you could just get away with compiling the one module and linking everything
but usually it would just error out
so yeah i do make clean almost every time if im having problems

Posted by renesis at 18:50 | permalink | 0 comments

if i have more than one \n i always do an extra printf("\n")
just to make it really obvious
hey so Makefile syntax is a little on crack
it fucking uses whitespace as an operator =( =( =(
well is a little program so im trying to do basic ones just to learn
so is neat it just recompiles what i edit, like its supposed to
when the shit isnt written with tons of variables they make sense
i know a lot of this stuff from when i was a 100% lunix dork
like i had to fuck with Makefiles to get some shit running long before i new anything about c
also gentoo
like, *everything* was built from source

Posted by renesis at 18:45 | permalink | 0 comments

yeah thats how i narrowed down the issue
why i started using eclipse
geanys gdb interface is a bit crackish
yeah i hover over vars and it shows shit
like, envSeg->length was -12637812837 or some shit
what do you use for your game?
okay so yeah, my vs express license expired
and i was like, wait shit that was a demo?
so installed lunix on a vm
because thats what i use in class
well, i have linux on a laptop
like, i compile his examples and try them as he lectures
which is neat because i catch all his little syntax errors
hes cool, he usually catches them all when explaining the code
naw mostly its \n
i dont say anything because i do that all the time

Posted by renesis at 18:40 | permalink | 0 comments

still died

Posted by renesis at 18:34 | permalink | 0 comments

cool i can fix that!
naw because i never fix that shit
its stepping past where it died before
i have a boring plot png
so plot.c finished so yeah everything working
how much
is donate?
cool, link
wanted to try it, got my wheel out of storage, been simracing
wtf is desura

Posted by renesis at 18:29 | permalink | 0 comments

right that doesnt deal with arrays
well, arrays of structures
it has arrays inside the structures but those never broke
it died a magnificent death this time
naw this is good
it got farther
i think plot.c has the same issues maybe

Posted by renesis at 18:22 | permalink | 0 comments

for (k = 0; k < (*envSeg)[j].length; ++k)
like that right
env->sample[i++] = (*envSeg)[j].sample[k];
env isnt an array so i can -> ?
okay jezus fuck
so arrays of structures are fucked because they are always two layers of pointers

Posted by renesis at 18:16 | permalink | 0 comments

yeah but i hadnt gotten that far to see that bug
it would have bee obvious in all the plots, everything straight line
damn seriously
how should i be doing this
i dont remember why it ended up like this
it just did, because arrays i think
so the problem is because of the arrays
thats why i cant ->
no i dont totally get what im doing

Posted by renesis at 18:11 | permalink | 0 comments

dies same place but im doing same thing
kinda but in the makeEnvSeg function
i only changed cliEnv

Posted by renesis at 18:06 | permalink | 0 comments

that maybe got deleted
k like that?
wait no, dots now
k it worked

Posted by renesis at 18:01 | permalink | 0 comments

i delete 157
because it allocates memory of the array of pointers that doesnt exist
*envSeg[i] = (structEnvSeg *) malloc(sizeof(structEnvSeg));
hmm k
then all envSeg become *envSeg

Posted by renesis at 17:53 | permalink | 0 comments

and i do foo->bar
what is getting edited
what is bar
thats what im doing right
right but im confused because array and possibly an extra pointer
i think the solution is to get more stoned\
okay so i have an array of structures
at some point im allocating an array of pointers to structures
youre saying thats dumb i should just have pointer that points to the array of structures

Posted by renesis at 17:48 | permalink | 0 comments

i do that
wait i dont understand
omg that just adds another lever of fuck
so when i pass a pointer to a structure

Posted by renesis at 17:43 | permalink | 0 comments

i dont know what that means
thats too much learning right now
oh its like code array
if i did that you wouldnt have taught me how to fix my thing

Posted by renesis at 17:38 | permalink | 0 comments

hmm wait
all of them?
thats the same thing
oh wait
damn yo thats alot of changing
because its a tiny program
coding is hard
my friend today is like YOU SHOULD DO CS INSTEAD OF EE
i was like, omg fu

Posted by renesis at 17:32 | permalink | 0 comments

where the fuck are the line numbers in eclipse
this isnt for microcontrollers
this is mostly boredom side project because i finish my c programming homework in one night
we have two weeks to do it
and i need to get better with c for microcontroller shit
what i mostly get it
my shit works when its not like arrays of shit three times deep + structures
hmm wait
envSeg is pointer to pointers of structures

Posted by renesis at 17:24 | permalink | 0 comments

so you saying even tho i pass the pointer
and am updating the parent structures elemtns
if i try and reassign the pointer to the structure
thats function specific
and gets tossed
because the fuction isnt dealing with the pointer its dealing with a copy of the pointer that has the same value
that makes sense
c always makes sense!
how did it work before then
because before i was passing the whole fucking strcture in
instead of the pointer
so changing all the . to -> broke it i guess

Posted by renesis at 17:15 | permalink | 0 comments

right be now it just destroys the envSeg sample array
and because i dont want shit copying huge sample blocks
wait if i malloc inside
itll kill it when i exit?
i thought that was the whole point
right its an address
okay okay

Posted by renesis at 17:10 | permalink | 0 comments

so back to main(), it gets out of cliEnv and jumps into makeEnv
and there is a malloc that uses the struct element envSeg[i]->length to set size
and that shit never initializes
like, length pointer goes into getInt() and shit never gets updated
eclipse said it was like, some huge negative number
im like, oh yeah that wont work in malloc
oh haha
yeah i have to chage that back
(*envSeg[i]).length is the same as envSeg[i]->length
its fucked up both ways
an array of structs?
there was a reason initially
i believe so makeEnvSeg could be called wherever makeEnv could be called

Posted by renesis at 17:05 | permalink | 0 comments

oh i went and pasted before reading what you said
so it gets to line 25
which jumps to line 151
so it gets to 177/179 and nothing updates
no it keeps calling getInt() until user puts in nontrash
returns 1 on trash
its a strtod wrapper
itll round if you tell it to

Posted by renesis at 17:00 | permalink | 0 comments

so the segfault makes sense now
oh god its so much

Posted by renesis at 16:54 | permalink | 0 comments

well im doing while(getnum(&ya[i]->someshit)
so my life is all full of fuck
also all the things are malloc'd
im like, maybe i am just doing gcc wrong
i tried that it didnt seem to make a difference
like, code hits a mallog and it segfaults
but i checked its because the sizeof() is multipling times a negative number because the struct member never initilizes
well right because its trying to allocated memory from limbo

Posted by renesis at 16:49 | permalink | 0 comments

gcc hates my codes now
so i have this shit it like gets string converts to float or int, checks to make sure no fucked characters, returns fail status
all like, int getnumbers(long * fknvar)
so like i do getnum(&j) shit is fine
but i have like, array of structures
so i do like, getnum(&ya[i]->someshit)
and someshit is not updating

Posted by renesis at 16:43 | permalink | 0 comments

u hi
in limbo, u?

Posted by renesis at 16:11 | permalink | 0 comments

Top | Add to Technorati Favorites

© 2007 lordpil.   XHTML 1.0! CSS! Site design by GNAA  Blog Engine by pbx | MULTI2 | ian hanschen | lolwat