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

Pages: 1-

/prog/ - my personal debugging army

Name: Anonymous 2008-03-30 19:30

Okay /prog/, here's something I can't work out:

squares.c:33: error: request for member 'x' in something not a structure or union
squares.c:34: error: request for member 'y' in something not a structure or union
squares.c:35: error: request for member 'z' in something not a structure or union


File squares.c, lines 32-36:
void moveSquare (Square * sqr, Vector * npos) {
        sqr->pos.x += npos.x;
        sqr->pos.y += npos.y;
        sqr->pos.z += npos.z;
}


squares.h:
typedef struct {
        Vertex verts[4];
        Vector pos, rot;
} Square;


Vector:
typedef ScePspFVector3 Vector;

And finally, in the #include <...> path:
typedef struct ScePspFVector3 {
        float   x;
        float   y;
        float   z;
} ScePspFVector3;


I'm completely stumped. Everything's in the right order. That's the only error I'm getting (so far). Is there some fundamental C convention that Google isn't telling me about? Help me [cpoiler]/prog/[/spoiler], you're my only hope.

Name: sage 2008-03-30 19:37

npos.

Name: Anonymous 2008-03-30 19:45

typedef Vector ScePspFVector3;
IHBT

Name: Anonymous 2008-03-30 19:46

DON'T HELP HIM!!!

Name: Anonymous 2008-03-30 20:15

>>1
npos is a pointer, . requires a struct or a union.
Do npos->x

Damn I feel sorry for you. I know how annoying bugs like this can be. Regardless you're a fag.

Name: Anonymous 2008-03-30 20:26

sqr->pos->x fag

Name: Anonymous 2008-03-30 21:32

>>5
More to the point, why is the OP passing a vector by reference?

Name: Anonymous 2008-03-30 22:33

>>7
Since he's obviously using the PSP homebrew toolchains and shit, I'd assume that he's pushing the vectors through hardware somehow. I'm not sure how the PSP is structured since I've only done DS stuff, but I don't think it's a farfetched jump to assume he's got to use some memory-mapped shit where vector ``allocation'' is just grabbing an open spot in some range of memory and throwing your shit down.

If this is the case, then passing by-value is pointless.

Since his Square class does store the vector by-reference, I have a feeling this may not be the case.

lol PSP and your faggy FPU. Real men use fixed-point systems.

Name: Anonymous 2008-03-31 6:11

>>5,6
chears guys
I must be blind or some shit like that.

Name: Anonymous 2008-03-31 6:19

>>9
Or maybe just stupid

Name: Anonymous 2008-03-31 6:35

******** YOU ARE A FAGGOT ********

Name: Anonymous 2009-03-06 6:11

Completely disjoint goals but   I still think   it sucks as   this adminestered poorly.

Name: Anonymous 2010-12-10 15:38

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