Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
filemanage Save Error
devilsclaw:
if the below comment was aimed at me it was missplaced since if you read the post i alread agreed with you.
--- Quote from: TDragon on March 31, 2007, 03:19:43 pm ---Apparently there's some part of my suggested code that you think is broken or incorrect; I assure you it's not.
With all due respect:
It's clear you're not familiar with the "ins and outs" of the C++ language. You'll end up writing a lot of code with good intentions, and then running into a lot of problems that, to more experienced developers, are simple mistakes simply fixed. I make no claims to speak for the official Code::Blocks developers, but I imagine it may be somewhat annoying to see the Code::Blocks Development forum filled with posts that have less to do with getting serious work done on C::B and more to do with you figuring out how C++ works.
--- End quote ---
This comment was towards Alturin and if you look lower you will see why.
and the only reason why i made the below comment is because of the crappy,
undocumented Code Completion that tweaked my brain. the code asumes
everything is correct it has functions that can used for error checking
but are not. some areas it should not be since if its to flexible on
now it parses things you wont know whats causing the corrupted data
but in other areas it needs it.
--- Quote from: devilsclaw on March 31, 2007, 08:49:53 am ---i found each compiler handles certain things differently.
bool hello = true;
wxFile f("myfile");
i know the MS compiler if you do a if statement if(!hello && f.write(_("2"),2) > 0)
since the hello is true it f.write does not get ran..
but the other day with the g++ for some reason there was a if statement that was like that and the code still got ran.
I dont know why and maybe i did something wronge but im pretty sure it was because how g++ compiled it.
so if f.write gets ran and it should not it might error.
but then again i might be wronge.. i will try to reproduce the probem i was running into and post it here.
--- End quote ---
--- Quote from: Alturin on March 31, 2007, 08:42:12 am ---How about this:
--- Code: ---if(mark_length && f.Write(mark, mark_length) != mark_length)
return false;
--- End code ---
This way it won't write anything when there's nothing to write?
--- End quote ---
in most cases Alturin code would work fine. the only time that it would mess up is if for one you ran
out of hard drive space, the file is trying to get larger then the OS's / FileSystems
allows or if the file is not locked and someone deletes it. and finally stream or cpu glitch.
these are mostly not common but can happen.
the likely hood of it returning -1 or less when the documentation says it returns bytes written
it cant write negative values. the only way that would even be possible is if something
was accessing memory it should not be, but then again better safe then sorry.
--- Quote from: Biplab on March 31, 2007, 04:00:13 pm ---@devil....
Please don't fill up the Developer forum with your crappy patches. I've tested some of your patches and they break more than they fix.
IMO, you are trying to show that Code::Blocks's 0.25 million lines of code is mere crap and is broken.
The problem is you are reading few lines of code and making 100 lines of comments. Try to understand why that piece of code is there and if you remove it what will happen to the remaining code.
I'm sorry if my reply seems harsh. But I can't stop writing this. I'm sick of your posts.
My suggestion, if you find any bugs, report it in Berlios. If you have fixed that, post it in Berlios. We'll test it and apply.
Don't use this forum to post each and every piece of code you write.
In short, Please Don't Pollute the Forum.
--- End quote ---
you are correct about my original patches. even said my self i was unsure.
and that why i have not posted another patch. everything else was tracing code down and pointing out the area.
but since i dont know the code as well as you who have been working on it for so long i was hoping for replies
in more detail so i could understand the coders intentions so that i would not fuck up like i did on the first
patches.
as for the other stuff i was just trying to be personalble and most of it i was asking for input.
TDragon:
--- Quote from: devilsclaw on March 31, 2007, 04:32:13 pm ---if the below comment was aimed at me it was missplaced since if you read the post i alread agreed with you.
--- Quote from: TDragon on March 31, 2007, 03:19:43 pm ---Apparently there's some part of my suggested code that you think is broken or incorrect; I assure you it's not.
--- End quote ---
--- End quote ---
My mistake. This comment was unnecessary.
--- Quote ---With all due respect:
It's clear you're not familiar with the "ins and outs" of the C++ language. You'll end up writing a lot of code with good intentions, and then running into a lot of problems that, to more experienced developers, are simple mistakes simply fixed. I make no claims to speak for the official Code::Blocks developers, but I imagine it may be somewhat annoying to see the Code::Blocks Development forum filled with posts that have less to do with getting serious work done on C::B and more to do with you figuring out how C++ works.
--- End quote ---
This one, I still stand by.
Biplab:
Please read the following thread first.
--- Quote ---http://forums.codeblocks.org/index.php/topic,1519.0.html
--- End quote ---
It has some general guidelines about what you should post here and what not to.
--- Quote from: devilsclaw on March 31, 2007, 04:32:13 pm ---as for the other stuff i was just trying to be personalble and most of it i was asking for input.
--- End quote ---
The code and the sdk manual is open. Nothing is closed. Read them and understand them.
This is not a forum where you'll ask input for each and every nooks and corner of C::B's source. We can help you if it is really important. But you may not get any response if you ask questions which is NOT relevant to Code::Blocks.
--- Quote from: TDragon on March 31, 2007, 03:19:43 pm ---... but I imagine it may be somewhat annoying to see the Code::Blocks Development forum filled with posts that have less to do with getting serious work done on C::B and more to do with you figuring out how C++ works.
--- End quote ---
I have the same feeling.
That's why my request to you: Don't Pollute the Forum.
devilsclaw:
unfortunately since i started off as a Assembly programmer your correct i dont know c++ as well as i do it.
in a way c++ is more flexible then asm and in others its restrictive but for a reason. its to help people from making mistakes
those bounderies at the things that mess me up sometimes.
when i code my stuff i have no problems. but im not the greatest at reading other peoples code. which is why im trying to document the
parser.
i started off modding the internals of games and making them work better or implementing something the company should of.
I i know memory handling and pointers very well and i actually do understand my logic and i can code just fine with it.
i never expect any of my original stuff to be flawless when im first comming into something because fucking up is the bast way to learn.
i just dont want to mess other people up which is why im posting the stuff im looking at and working on in hopes of corrective input.
thomas:
May I inquire as to the reason why a piece 100% reliably working code is disputed at all, and what "error" it is you see?
wxFile::Write calls wxWrite, which is a wrapper for WriteFile (http://msdn2.microsoft.com/en-us/library/aa365747.aspx) under Windows and fwrite (http://www.die.net/doc/linux/man/man2/write.2.html) on all other platforms.
Both OS Functions explicitely allow zero writes (implemented as no-op) and return the number of bytes actually written. wxFile::Write asserts that the data pointer is non-zero (which makes sense), but makes no assumptions about the size.
So, what exactly is your problem? What are we talking about, anyway?
The same goes for this:
--- Quote from: devilsclaw on March 31, 2007, 03:51:19 pm ---the original code was doing the line.getchar even though it was not supposed to
--- End quote ---
It seems you really don't understand what is intended, nor what is actually happening (because your statement is wrong).
Navigation
[0] Message Index
[*] Previous page
Go to full version