forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

problem with my sceIoOpen code...

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
TheSamuraiElephant



Joined: 04 Aug 2005
Posts: 17

PostPosted: Tue Sep 13, 2005 1:42 am    Post subject: problem with my sceIoOpen code... Reply with quote

I'm getting the error "passing argument 2 of 'sceIoRead' makes pointer from integer without a cast" back from cygwin about the following bit of code:

Code:
   //open file and start reading
   fdin = sceIoOpen(filename, PSP_O_RDONLY, 0777);
   if(fdin >= 0)
   {
      printf("File opened %s\n", filename);
      char ID[2];
      unsigned int chunksize = 1;
      int bytes_read = 1;
      bytes_read = sceIoRead(fdin, ID, sizeof(ID));
      printf("Number of read bytes: %i\n", bytes_read);
      printf("ID: %s\n", ID);
      bytes_read = sceIoRead(fdin, chunksize, sizeof(chunksize));
      printf("Number of read bytes: %i\n", bytes_read);
      printf("ID: %i\n", chunksize);
   }
   else
   {
      printf("Couldn't open %s\n", filename);
   }


I basically just want to read 2 bytes into "ID" and display these 2 bytes as 2 char's and then read 4 bytes into "chunksize" and display as an integer.
I'm kind of a newbie, so apologies for asking such a newbie question.

Any help would be appreciated,
Cheers.
Back to top
View user's profile Send private message
weltall



Joined: 20 Feb 2004
Posts: 310

PostPosted: Tue Sep 13, 2005 2:46 am    Post subject: Reply with quote

it should work with a & before id in the line where is the sceioread.
the second argument of sceioread is a pointer
Back to top
View user's profile Send private message Visit poster's website
TheSamuraiElephant



Joined: 04 Aug 2005
Posts: 17

PostPosted: Wed Sep 14, 2005 2:01 am    Post subject: Reply with quote

cheers, that works fine now (both sceIoRead lines required changing).
Thanks! :)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group