21 Feb, 2008, David Haley wrote in the 21st comment:
Votes: 0
I take from it that you are unwilling to back up a very specific claim you made when all it would take is a very simple statement. :sad: :sigh:
21 Feb, 2008, KaVir wrote in the 22nd comment:
Votes: 0
Samson said:
David's question was perfectly valid btw, since I've yet to run into any sort of architecture either where integer rollover results in a zero value.


I've never encountered one either, although drrck is at least partially correct about integer overflows - they cause undefined behaviour (not implementation-defined behaviour) for signed integer types (but not unsigned types).

K&R states: "The handling of overflow, divide check, and other exceptions in expression evaluation is not defined by the language. Most existing implementations of C ignore overflow in evaluation of signed integral expressions and assignments, but this behavior is not guaranteed."

The C standard (ISO/IEC 9899:1999, section 6.5, paragraph 5) states: "If an exceptional condition occurs during the evaluation of an expression (that is, if the result is not mathematically defined or not in the range of representable values for its type), the behavior is undefined." but also clarifies that "A computation involving unsigned operands can never overflow, because a result that cannot be represented by the resulting unsigned integer type is reduced modulo the number that is one greater than the largest value that can be represented by the resulting type."

Having said that, in this case we're not talking about overflow, but rather the conversion of a value that can't fit into the target type - and that is implementation-defined:

http://m68hc11.serveftp.org/doc/gcc_4.ht...

"A conforming implementation of ISO C is required to document its choice of behavior in each of the areas that are designated "implementation defined." The following lists all such areas, along with the section number from the ISO/IEC 9899:1999 standard."

And later: "The result of, or the signal raised by, converting an integer to a signed integer type when the value cannot be represented in an object of that type (6.3.1.3)."
22 Feb, 2008, Conner wrote in the 23rd comment:
Votes: 0
Samson said:
Simply answering the question would have saved at least two of us the time, and shared some knowledge with others. Isn't that what we're all here for in the end?


Apparently, that's what all of us except Drrck are here for, he's here to prove to the world that he's the foremost expert on everything code related because he says so rather than because he's got sources for his information nor because he can demonstrate in any way that others could appreciate… just because he told us so.

I was always taught that when involved in a debate and the other person asked for a citation of where your data or argument was coming from/based upon, it generally invalidated your data/argument if you refused to provide either the citation or a reasonable explanation of why you couldn't. In this case at least three of us blatantly asked for his source (and I'm not even addressing other threads at the moment where he's done the same thing but even worse) and he accused the first of being a "die-hard skeptic", the second of being a "trolling cheer-leader" "just to be on the bandwagon", and completely ignored the third. I'm ready to call "Bullshit" with noted exception made for KaVir's comments in the post before this one.
22 Feb, 2008, syn wrote in the 24th comment:
Votes: 0
You thought it was to prove being an expert just about code? :evil:

-Syn
22 Feb, 2008, drrck wrote in the 25th comment:
Votes: 0
Sorry, make that 3.
22 Feb, 2008, syn wrote in the 26th comment:
Votes: 0
So youll add useless responses, but not post a source of information that would be pertinent or useful for the discussion?

Cheer-leading troll indeed

-Syn
22 Feb, 2008, Darwin wrote in the 27th comment:
Votes: 0
I'm curious as to the reason for the strange output. If there does indeed exist a system where an overflow would result in a 0 value, one in which is, or could be, used by MUD administrators, that information would be nice to know as well.

Now, if I were to say "Yay! Go, drrck!" would I be a cheer-leading troll, or would I be cheer-leading the troll? :smirk:
22 Feb, 2008, Tommi wrote in the 28th comment:
Votes: 0
Quote
Now, if I were to say "Yay! Go, drrck!" would I be a cheer-leading troll, or would I be cheer-leading the troll? :smirk:


Are you wearing a pleated skirt and carrying pom poms?
23 Feb, 2008, kiasyn wrote in the 29th comment:
Votes: 0
I just scrolled up an entire page and can't figure out if he ever got the sprintf working.. Come on guys..
23 Feb, 2008, syn wrote in the 30th comment:
Votes: 0
Well we are waiting for the entire function.. otherwise there isnt much anyone can do..
23 Feb, 2008, David Haley wrote in the 31st comment:
Votes: 0
The entire function, or a report on setting a breakpoint in gdb, or a report on running valgrind, or … as syn says we're really just stuck for now. :wink:
23 Feb, 2008, Tommi wrote in the 32nd comment:
Votes: 0
Or more stories of guys in cheerleaders outfits dancing with pom poms to the theme music of All Authorities staring drrck. :lol:
23 Feb, 2008, Guest wrote in the 33rd comment:
Votes: 0
I asked him to post the entire function earlier on, we can speculate all we want on what exactly is going on but it does no good without the function itself. Someone is bound to spot some kind of weirdness and go "AHA!" after seeing it.
04 Mar, 2008, Kline wrote in the 34th comment:
Votes: 0
Sorry for such a gap in my posting, just got extremely busy with a residency course I'm stuck in for work right now that everything else went back burner on me. I actually just remembered this today!

I've placed the entire function up at http://games.gotr00t.us/vortex/files/voi... for anybody who wishes to look at it. This weekend I'll try to make time to swap the arguments to sprintf per suggestion and see if that makes any difference. I've gone through Valgrind I don't know how many times just looking to fix errors and optimize where I can throughout the game and it has never specifically thrown errors from this function.

Thanks for all the assistance, despite my sorely lacking in participation :P
04 Mar, 2008, David Haley wrote in the 35th comment:
Votes: 0
Hmm, this function is big enough that it's hard to just eyeball it and see what's going on. The only real way to help at this point I think would be to have access to the whole running system to be able to look at the gdb output – either that or you'd provide the output for us to look at.
04 Mar, 2008, syn wrote in the 36th comment:
Votes: 0
I wonder which godwars base that came out of.
04 Mar, 2008, Guest wrote in the 37th comment:
Votes: 0
Well from what I can tell, prior to reaching the point where it's displaying the 0 value, these are the only calculations done on the "statcap" integer:
statcap += (ch->race * 100);
statcap += (ch->pcdata->remort * 3000);
statcap += (ch->pkill * 25);
statcap -= (ch->pdeath * 10);


Honestly, I don't get it. I see nothing even in the expanded function that should be causing issue unless act2() is somehow trashing the value.
04 Mar, 2008, Kline wrote in the 38th comment:
Votes: 0
DavidHaley said:
Hmm, this function is big enough that it's hard to just eyeball it and see what's going on. The only real way to help at this point I think would be to have access to the whole running system to be able to look at the gdb output – either that or you'd provide the output for us to look at.

Is there a rough primer available someplace on good use of GDB BP's? I'll happily go along with that if it's needed. My GDB knowledge is about limited to playing with cores to figure out where I broke something badly :)

syn said:
I wonder which godwars base that came out of.

I want to say Dystopia X-Mas? The one previously used was quite the eyesore and hard to modify…So why re-invent the wheel? Just find a working one and edit accordingly :)
04 Mar, 2008, syn wrote in the 39th comment:
Votes: 0
Thats true, some of them are real real bad, that one isnt as bad hehe.
04 Mar, 2008, David Haley wrote in the 40th comment:
Votes: 0
Sure, here's a pretty good one:
http://www.gammon.com.au/forum/bbshowpos...

You can skip directly to the section on breakpoints by searching for: "For our next trick, let's try adding some breakpoints"
20.0/50