My own questions and suggestions to the ReactOS Team

Ask your support questions in here

Moderator: Moderator Team

Re: My own questions and suggestions to the ReactOS Team

Postby vicmarcal » Tue Mar 10, 2009 2:29 pm

falkTX wrote:Actually I still don't know why I should write 'return 0', but it seems to work


Well the basic is to know what means "return 0".
Your main is declared as INT main (), that means it needs to return something. If you want your main doesnt return anything you can just use VOID main().
The INT main usually returns a 0 if the program has completed all its task in a normal way, if the main returns a 1 means an Error has happened and it didnt complete the task(i.e: CHA1() or CHA2() didnt finish because the user didnt introduce a correct value).
So you have (if you want your main return something) to control which value is your INT main returning.


Code: Select all
    int main()
    {
    CHA1();
    if (result[0] == 1)
       CHA2();
    if (result[1] == 1)
       CHA3();
    else
       return 0;
    }


Lets begin reading the code...the code begin executing CHA1(),if the user introduce a correct value then result[0]=1, now in the main we check it in the first if, it is correct so CHA2() is executed, when CHA2() is executed correctly then result[1] is equal to1 so the second if is correct and we execute CHA3(). If CHA2() was executed incorrectly(the user didnt provide a number between 3 and 80) then result[1] isnt 1 so the else catch this situation and return 0.

But "INT main" isnt returning anything if the USER has made ALL CORRECTLY ;)....It´s returning 0 if the user has made somethign wrong and return "who knows?" if all has been done right :)...Try to fix it ;) it´s easy :)

BTW you are trusting in just one "return 0" to catch a fail in CHA1() or CHA2()...that is not a good thing.why?
IF CHA1() fails ...you will check the first IF ,then the second IF and then you will return 0. Your program is executing code to arrive to the return 0.
Remember that when you arrive to a return automatically the app returns the value and STOPS the execution.This is good to prevent checking and checking to arrive to the end. Sure you can fix this too ;).
Also you can return anything: 0,1,2,3,4 of course an INT since your main is INT main. Why returning different values?to know which CHA() was the erroneus one...if CHA1() fails you could return 1 if the CHA2() fails then you can return 2 ;)...so...you can control in which the USER has set a wrong number. Much more useful ;)

A Logical Diagran tree is an useful Diagram to follow from top to botton the execution of code.It represents all the posibilities in a graphic, so you can control any problem of erroneus way of work really easy.
Image
vicmarcal
Test Team
 
Posts: 2355
Joined: Mon Jul 07, 2008 12:35 pm

Re: My own questions and suggestions to the ReactOS Team

Postby GoBusto » Tue Mar 10, 2009 2:45 pm

If I recall correctly, the main() function of any program should generally look like this:

Code: Select all
int main(int argc, char *argv[])
{
  return 0;
}


You can use int main() or void main() sometimes, but if your compiler starts complaining then it's most likely because it expects the exact version of main() outlined above.

As vicmarcal said, the int part of int main() means that the function will need to return an integer of some kind. Usually, this is zero when no problems have been encountered.

The int argc and char *argv[] arguments introduced above are used to pass parameters to the program. argv is an array of command-line strings. The number of strings in that array is given by argc:

Code: Select all
argv[0]
argv[1]
argv[2]
...
argv[argc-2]
argv[argc-1]


argc will always be at least one, since argv[0] is the path to the program itself. If it is more than one, argv[1] and onwards contain command line arguments.
GoBusto
 
Posts: 579
Joined: Fri Jan 25, 2008 11:13 am
Location: UK

Re: My own questions and suggestions to the ReactOS Team

Postby falkTX » Wed Mar 11, 2009 4:37 pm

Read development introduction and translation introduction.

I've already looked at the wiki pages... (but thanks anyway).

I guess I wasn't clear enough:
How can I start modifying files on the ReactOS trunk?
Diff/patch files? Or download the last SVN code, modify it and upload it?

I'm not sure what is the best option
falkTX
 
Posts: 16
Joined: Wed Feb 11, 2009 1:19 pm

Re: My own questions and suggestions to the ReactOS Team

Postby vicmarcal » Wed Mar 11, 2009 5:11 pm

*Install Tortoise SVN
*Download ReactOS trunk
*Change any file you want
*right click on it->Make the patch
*Upload the patch to OUR bugzilla
*Our Devs will check it and upload to the SVN trunk
Image
vicmarcal
Test Team
 
Posts: 2355
Joined: Mon Jul 07, 2008 12:35 pm

Re: My own questions and suggestions to the ReactOS Team

Postby falkTX » Wed Mar 11, 2009 5:47 pm

*Install Tortoise SVN
*Download ReactOS trunk
*Change any file you want
*right click on it->Make the patch
*Upload the patch to OUR bugzilla
*Our Devs will check it and upload to the SVN trunk

Thanks, but it seems that I need to run Windows for that, and I'm currently with Ubuntu.
I have VirtualBox, so I guess I'll have to install Vista. Maybe there's a way too for Linux, so I'll check it out first
falkTX
 
Posts: 16
Joined: Wed Feb 11, 2009 1:19 pm

Re: My own questions and suggestions to the ReactOS Team

Postby vicmarcal » Wed Mar 11, 2009 6:12 pm

Well you can use any SVN manager. TortoiseSVN is nice for Windows.Choose one for Linux.
BTW we have a RosBE UNIX version...so you can use all the commands in UNIX too.
Image
vicmarcal
Test Team
 
Posts: 2355
Joined: Mon Jul 07, 2008 12:35 pm

Postby hto » Wed Mar 11, 2009 6:33 pm

I use command line tools under GNU / Linux. Maybe they look worse then Windows tools, but work well. :)
hto
 
Posts: 2186
Joined: Sun Oct 01, 2006 3:43 pm

Re: My own questions and suggestions to the ReactOS Team

Postby falkTX » Wed Mar 11, 2009 7:35 pm

I use command line tools under GNU / Linux. Maybe they look worse then Windows tools, but work well.

You're right. Linux always have the tools needed for everything, but sometimes they don't have a gui. Still, I'm not sure if Visual C2008Express will work on wine.
falkTX
 
Posts: 16
Joined: Wed Feb 11, 2009 1:19 pm

Re: My own questions and suggestions to the ReactOS Team

Postby Lone_Rifle » Wed Mar 11, 2009 7:37 pm

falkTX wrote:
I use command line tools under GNU / Linux. Maybe they look worse then Windows tools, but work well.

You're right. Linux always have the tools needed for everything, but sometimes they don't have a gui. Still, I'm not sure if Visual C2008Express will work on wine.


Er, we use our own build environment, which is available both on Linux and Windows. See http://www.reactos.org/wiki/index.php/R ... nvironment
Lone_Rifle
Test Team
 
Posts: 802
Joined: Thu Apr 03, 2008 2:17 pm

Re: My own questions and suggestions to the ReactOS Team

Postby GoBusto » Wed Mar 11, 2009 8:21 pm

falkTX wrote:
I use command line tools under GNU / Linux. Maybe they look worse then Windows tools, but work well.

You're right. Linux always have the tools needed for everything, but sometimes they don't have a gui. Still, I'm not sure if Visual C2008Express will work on wine.


You could try using Code::Blocks instead. It's what I use under both Windows and UNIX-like OSes and I think it's pretty good. Plus, it has the ability to import MS Visual C++ project files.
GoBusto
 
Posts: 579
Joined: Fri Jan 25, 2008 11:13 am
Location: UK

Re: My own questions and suggestions to the ReactOS Team

Postby falkTX » Mon Mar 23, 2009 1:30 pm

Code:Blocks is really awesome. The fact that it's opensource/cross-platform is even better! Thanks for the tip.

Now I'm (trying) to learn Qt4, cause my objective is to make GUIs. Maybe, once I get used to it, I'll try to make an alternate explorer
falkTX
 
Posts: 16
Joined: Wed Feb 11, 2009 1:19 pm

Re: My own questions and suggestions to the ReactOS Team

Postby Haos » Mon Mar 23, 2009 3:08 pm

Please mind that QT4 apps are still far from being considered as native on Win32. So you have to expect not so good performance.
Haos
Test Team
 
Posts: 2954
Joined: Thu Mar 22, 2007 5:42 am

Re: My own questions and suggestions to the ReactOS Team

Postby falkTX » Tue Mar 24, 2009 11:11 am

So you have to expect not so good performance.

I like cross-platform stuff, and (I think) Qt4 is the best GUI toolkit for this; If you know any better, please tell me
falkTX
 
Posts: 16
Joined: Wed Feb 11, 2009 1:19 pm

Re: My own questions and suggestions to the ReactOS Team

Postby GoBusto » Tue Mar 24, 2009 12:03 pm

falkTX wrote:
So you have to expect not so good performance.

I like cross-platform stuff, and (I think) Qt4 is the best GUI toolkit for this; If you know any better, please tell me


I like to make my code cross platform as well, but I'd have to admit that the best GUI toolkit out there is Win32. So you'll have to decide what you want: Good performance or platform independance.

Here are some other GUI toolkits in case you decide to go with the second option.

PS: Based on personal experience, the Juce toolkit is VERY SLOW.

EDIT: Of course, you could just write your code in such a way that the 'Logic' part of your program doesn't need to know about the implementation details of the 'GUI' part, and then use a different "gui.c" file for each target platform.
GoBusto
 
Posts: 579
Joined: Fri Jan 25, 2008 11:13 am
Location: UK

Re: My own questions and suggestions to the ReactOS Team

Postby Z98 » Tue Mar 24, 2009 6:27 pm

Whatever your particular opinion regarding any GUI toolkit, the position of the project is that we only accept Win32 apps written in C, with exceptions for C++ given on a case by case basis. We do not accept anything else because that would vastly complicate our current build process by adding in unnecessary dependencies.
Z98
Release Engineer
 
Posts: 2547
Joined: Tue May 02, 2006 8:16 pm

PreviousNext

Return to Support

Who is online

Users browsing this forum: No registered users and 0 guests