www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Variables too big (std.date (...) int day???)

reply orgoton <orgoton mindless.com> writes:
On my programming style, I always use the smallest variable possible.

Currently I'm updating the DDoc documentation on Phobos (using the sources
found on /src/phobos).

First and foremost, these are the sources that I should be altering right?
Later on I'm going to upload them to BugZilla on issue 667
(http://d.puremagic.com/issues/show_bug.cgi?id=677), is this the right place?

Second, I noticed that in some places, too big variable types are used, like
"int day" when the number is never expected to be smaller than 31. Why not use
something like "ubyte day"? Should I change this or should I limit myself on
Documentation Comments?

Third, the changes I made get reviewed by someone before inclusion on Phobos,so
that any typos and such get correct. Am I correct?

Thanks very much for any answers.
Feb 07 2007
parent Lionello Lunesu <lio lunesu.remove.com> writes:
Sorry for not replying inline, but Thunderbird did not wrap the lines of 
your message, for some reason.

1) Bugzilla is the right place, although I would get some confirmation 
from Walter before you spend a lot of time on it. He's quite critical of 
patches for Phobos.

2) It depends whether that structure is used in other APIs, I guess. If 
it's a known windows/posix/dos structure, then you should leave it 
alone. If it's only used in Phobos you can change it, but remember the 
alignment rules: one ubyte in a struct with int does not solve anything 
and is better left int.

3) Yes, Walter reviews changes and, like I've said, he's pretty 
critical. Many patches have been made to Phobos, but only few have made 
it in. Most likely this is because he's a busy guy, so don't get mad if 
your patches don't make it into Phobos. You can always keep using your 
own Phobos (that's what I do ;). Or you can post your patches to the 
Tango project, they seem more "open" :)

L.
Feb 08 2007