* [U-Boot] console_buffer
@ 2010-03-24 19:52 Frans Meulenbroeks
2010-03-24 20:00 ` Ben Warren
0 siblings, 1 reply; 6+ messages in thread
From: Frans Meulenbroeks @ 2010-03-24 19:52 UTC (permalink / raw)
To: u-boot
yet another potential cleanup:
I see both:
extern char console_buffer[];
and
extern char console_buffer[CONFIG_SYS_CBSIZE];
(and in fact console_buffer is declared as:
char console_buffer[CONFIG_SYS_CBSIZE + 1]; /* console I/O buffer */
so with a +1).
Questions:
is the first or the 2nd form preferred?
and if it is the 2nd form should it not have the +1?
and wouldn't it be better to have this extern in a .h file (and if so
which one)?
Frans
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] console_buffer
2010-03-24 19:52 [U-Boot] console_buffer Frans Meulenbroeks
@ 2010-03-24 20:00 ` Ben Warren
[not found] ` <ac9c93b11003241320u5b0723f1uc9850243110fdf1f@mail.gmail.com>
2010-03-24 21:08 ` Wolfgang Denk
0 siblings, 2 replies; 6+ messages in thread
From: Ben Warren @ 2010-03-24 20:00 UTC (permalink / raw)
To: u-boot
Hi Frans,
On 3/24/2010 12:52 PM, Frans Meulenbroeks wrote:
> yet another potential cleanup:
>
> I see both:
> extern char console_buffer[];
> and
> extern char console_buffer[CONFIG_SYS_CBSIZE];
>
> (and in fact console_buffer is declared as:
> char console_buffer[CONFIG_SYS_CBSIZE + 1]; /* console I/O buffer */
> so with a +1).
>
> Questions:
> is the first or the 2nd form preferred?
> and if it is the 2nd form should it not have the +1?
> and wouldn't it be better to have this extern in a .h file (and if so
> which one)?
>
>
Your interest is definitely appreciated. As a general remark, you're
more likely to get meaningful feedback if you just submit what you think
is best. You'll get more feedback when people don't like what you did,
but any EE will tell you that negative feedback is the path to stability :)
> Frans
>
regards,
Ben
^ permalink raw reply [flat|nested] 6+ messages in thread[parent not found: <ac9c93b11003241320u5b0723f1uc9850243110fdf1f@mail.gmail.com>]
* [U-Boot] console_buffer
[not found] ` <ac9c93b11003241320u5b0723f1uc9850243110fdf1f@mail.gmail.com>
@ 2010-03-24 20:25 ` Frans Meulenbroeks
2010-03-25 8:31 ` Detlev Zundel
0 siblings, 1 reply; 6+ messages in thread
From: Frans Meulenbroeks @ 2010-03-24 20:25 UTC (permalink / raw)
To: u-boot
Oops. Replied to Ben only not to the list. Here is my reply.
Actually did a quick grep -r -w afterwards: there are roughly 475 .c
files with extern in it.
Guess this is a more widely spread issue.
(btw personally I feel that it is a sign of clean programming to
declare all exported functions in a header file, and only to use
header files to import functions, but maybe that is a personal
thingie).
Frans
2010/3/24 Frans Meulenbroeks <fransmeulenbroeks@gmail.com>:
> 2010/3/24 Ben Warren <biggerbadderben@gmail.com>:
>> Hi Frans,
>>
>> On 3/24/2010 12:52 PM, Frans Meulenbroeks wrote:
>>>
>>> yet another potential cleanup:
>>>
>>> I see both:
>>> extern char console_buffer[];
>>> and
>>> extern char console_buffer[CONFIG_SYS_CBSIZE];
>>>
>>> (and in fact console_buffer is declared as:
>>> char ? ? ? ?console_buffer[CONFIG_SYS_CBSIZE + 1]; ? ? ?/* console I/O
>>> buffer ? */
>>> so with a +1).
>>>
>>> Questions:
>>> is the first or the 2nd form preferred?
>>> and if it is the 2nd form should it not have the +1?
>>> and wouldn't it be better to have this extern in a .h file (and if so
>>> which one)?
>>>
>>>
>>
>> Your interest is definitely appreciated. ?As a general remark, you're more
>> likely to get meaningful feedback if you just submit what you think is best.
>> ?You'll get more feedback when people don't like what you did, but any EE
>> will tell you that negative feedback is the path to stability :)
>
> You have a point.
> Well, I have not too strong opinions on this one, but I like consistency.
> But if I have a choice I prefer to have it in an include file (but I
> am not too eager to create one for this sole declaration.
>
> Frans (who actually is an EE :-) )
>
^ permalink raw reply [flat|nested] 6+ messages in thread* [U-Boot] console_buffer
2010-03-24 20:25 ` Frans Meulenbroeks
@ 2010-03-25 8:31 ` Detlev Zundel
0 siblings, 0 replies; 6+ messages in thread
From: Detlev Zundel @ 2010-03-25 8:31 UTC (permalink / raw)
To: u-boot
Hi Frans,
> (btw personally I feel that it is a sign of clean programming to
> declare all exported functions in a header file, and only to use
> header files to import functions, but maybe that is a personal
> thingie).
Seconded. Any patch to this end is highly welcome ;)
Cheers
Detlev
--
I've never understood the tendency to pick up tastes because they are popular.
In fact, I think it is foolish to do that. I mean, don't you know what you
like? People who are so weak that they will take their tastes from people
around them in the desperate desire to be accepted, I think of them as
cowards. -- Richard M. Stallman
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] console_buffer
2010-03-24 20:00 ` Ben Warren
[not found] ` <ac9c93b11003241320u5b0723f1uc9850243110fdf1f@mail.gmail.com>
@ 2010-03-24 21:08 ` Wolfgang Denk
2010-03-24 21:12 ` Ben Warren
1 sibling, 1 reply; 6+ messages in thread
From: Wolfgang Denk @ 2010-03-24 21:08 UTC (permalink / raw)
To: u-boot
Dear Ben,
In message <4BAA6F5C.5060002@gmail.com> you wrote:
>
> ... You'll get more feedback when people don't like what you did,
> but any EE will tell you that negative feedback is the path to stability :)
May I add this to my list of signature quotes?
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
In a survey taken several years ago, all incoming freshmen at MIT
were asked if they expected to graduate in the top half of their
class. Ninety-seven percent responded that they did.
^ permalink raw reply [flat|nested] 6+ messages in thread* [U-Boot] console_buffer
2010-03-24 21:08 ` Wolfgang Denk
@ 2010-03-24 21:12 ` Ben Warren
0 siblings, 0 replies; 6+ messages in thread
From: Ben Warren @ 2010-03-24 21:12 UTC (permalink / raw)
To: u-boot
On 3/24/2010 2:08 PM, Wolfgang Denk wrote:
> Dear Ben,
>
> In message<4BAA6F5C.5060002@gmail.com> you wrote:
>
>> ... You'll get more feedback when people don't like what you did,
>> but any EE will tell you that negative feedback is the path to stability :)
>>
> May I add this to my list of signature quotes?
>
>
Sure, under GPL v3 ;)
> Best regards,
>
> Wolfgang Denk
>
regards,
Ben
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-03-25 8:31 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-24 19:52 [U-Boot] console_buffer Frans Meulenbroeks
2010-03-24 20:00 ` Ben Warren
[not found] ` <ac9c93b11003241320u5b0723f1uc9850243110fdf1f@mail.gmail.com>
2010-03-24 20:25 ` Frans Meulenbroeks
2010-03-25 8:31 ` Detlev Zundel
2010-03-24 21:08 ` Wolfgang Denk
2010-03-24 21:12 ` Ben Warren
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox