Temtaime Posted June 26, 2012 Group: Members Topic Count: 4 Topics Per Day: 0.00 Content Count: 48 Reputation: 87 Joined: 05/15/12 Last Seen: May 23, 2021 Share Posted June 26, 2012 (edited) Hello for all. :3 I'm release my fastest grf library, written in C++. It supports grf files with version 0x1** or 0x200. For more info see docs/html/index.html. It goes with my custom common library, which i will release sooner at sf.net. So i'm sorry for documentation misses in some places. Grf lib also have example. Example - useful program to pack/unpack grf files. For more info about example just run help.bat. If you like it, u can support me to future releases: WMZ: Z866169295097. Yandex: 41001310943642. And sorry for my Eng, i'm Ru. P.S. also looking for remote job as C/C++ programmer. Write to pm. AVE Patch coming soon! archive.7z Edited July 5, 2012 by Temtaime Quote Link to comment Share on other sites More sharing options...
Temtaime Posted July 8, 2012 Group: Members Topic Count: 4 Topics Per Day: 0.00 Content Count: 48 Reputation: 87 Joined: 05/15/12 Last Seen: May 23, 2021 Author Share Posted July 8, 2012 I have upload second release of libgrf with some code cleanup. Now u can access it here: http://src.japp.ru/hg/user/randajad/public Quote Link to comment Share on other sites More sharing options...
ViteFalcon Posted July 13, 2012 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 7 Reputation: 1 Joined: 03/19/12 Last Seen: December 18, 2022 Share Posted July 13, 2012 Thanks for sharing your code. I do however have one concern, you're using 'goto' in your code. You should ideally not use goto statements. In your case, you use goto to exit a conditional block, which is bad practice. You should ideally be throwing an exception, catching it and doing whatever is required if a bad_grf exception happens. That's just one of the problems I find with your code. I'll have a better look later and report if I find more. Don't take this critisim in a bad way. Take it as points to improve your programming skills Quote Link to comment Share on other sites More sharing options...
Temtaime Posted July 13, 2012 Group: Members Topic Count: 4 Topics Per Day: 0.00 Content Count: 48 Reputation: 87 Joined: 05/15/12 Last Seen: May 23, 2021 Author Share Posted July 13, 2012 (edited) Thanks for answer! Yes, i clear. There only 1 goto, without it i would have to duplicate code. I try to avoid gotos everywhere where i can. But okay, i try to rewrite this. Also, it's throws exception where it's needed. Edited July 13, 2012 by Temtaime Quote Link to comment Share on other sites More sharing options...
ViteFalcon Posted July 14, 2012 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 7 Reputation: 1 Joined: 03/19/12 Last Seen: December 18, 2022 Share Posted July 14, 2012 Actually there are 9 'goto' statements in grf.cpp alone. I haven't taken the time to hunt for other goto statements. I had trouble compiling it in VS2010 due to the variable template argument functions. Rewriting those functions to use va_list, va_start to get variable arguments to send it to your custom printf and aprintf functions works for me. I should mention though that it's really fast to open and list contents in a GRF file. I'm trying to find out how fast it would be to find and read contents of a file. I see that you're using boost. Good choice! I'm still studying the code. Will let you know of my comments soon. As an example of what you should've done instead of goto statement, you could've created a function called: mark_dirty(); The code that you jump to should be the body of that function. Does that make sense? Quote Link to comment Share on other sites More sharing options...
Temtaime Posted July 30, 2012 Group: Members Topic Count: 4 Topics Per Day: 0.00 Content Count: 48 Reputation: 87 Joined: 05/15/12 Last Seen: May 23, 2021 Author Share Posted July 30, 2012 I review my code and found no problem with goto. All goto calls go to one place, so there no problem with goto, i think. Sorry, VS 2010 doesn't supported. Use GCC or ICC instead. I'd like to use C++11 features. http://sourceforge.net/projects/mingwbuilds/ Here you can get latest GCC builds for windows. Quote Link to comment Share on other sites More sharing options...
Ai4rei Posted July 31, 2012 Group: Members Topic Count: 8 Topics Per Day: 0.00 Content Count: 425 Reputation: 359 Joined: 11/11/11 Last Seen: April 3 Share Posted July 31, 2012 crypt.cpp looks pretty familiar, so I don't think you should attribute it to yourself when you did not write it, but only modified it a little. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.