← Back to team overview

kicad-developers team mailing list archive

Re: Bugfix for plotting

 

--000e0cd242c682927c046d8cfe82 Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

2009/6/30 Lorenzo <lomarcan@...>

>
>
> This fixes the reported issues.
>
> A note about the coding style: the * attached to the type name is
> deceptive: C is not Pascal, the pointer modifiers apply only to the first
> element!
>
>









But, you should always avoid the following:
int *ptr, val;
as it always leads to misunderstandings. Most coding standard mention about
this.

The way how pointers are marked in C is somewhat confusing, in other hand
the same operator marks pointer declaration and pointer dereference - that
seemed logical to language authors.

I saw advice to declare only one variable at a time in many places, so
programmer should avoid constructs like:
int a,b,c;
But lot of people argues that such style creates lot of source code lines
and takes too much time to type.

I am curious what Dick is thinking about it.

--
M.
 --000e0cd242c682927c046d8cfe82 Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<br><br><div class=3D"gmail_quote">2009/6/30 Lorenzo <span dir=3D"ltr">&lt;=
<a href=3D"mailto:lomarcan@...";>lomarcan@...</a>&gt;</span><br><block=
quote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, 204, 2=
04); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">










<div style=3D"background-color: rgb(255, 255, 255);">


<div style=3D"width: 655px;">
<div style=3D"margin: 0pt; padding: 0pt 25px 0pt 0pt; width: 470px; float: =
left;">


<div>
=20=20=20=20=20=20=20=20=20=20=20=20
<br><br>
=20=20=20=20=20=20
<p>This fixes the reported issues.<br>
<br>
A note about the coding style: the * attached to the type name is deceptive=
: C is not Pascal, the pointer modifiers apply only to the first element!<b=
r>
<br>
</p></div></div></div></div></blockquote></div><br><br><br><br><br><br><br>=
<br><br><br><br>But, you should always avoid the following:<br><span style=
=3D"font-family: courier new,monospace;">int *ptr, val;</span><br>as it alw=
ays leads to misunderstandings. Most coding standard mention about this.<br=
>
<br>The way how pointers are marked in C is somewhat confusing, in other ha=
nd the same operator marks pointer declaration and pointer dereference - th=
at seemed logical to language authors.<br><br>I saw advice to declare only =
one variable at a time in many places, so programmer should avoid construct=
s like:<br>
<span style=3D"font-family: courier new,monospace;">int a,b,c;</span><br>Bu=
t lot of people argues that such style creates lot of source code lines and=
takes too much time to type.<br><br>I am curious what Dick is thinking abo=
ut it.<br>
<br>--<br>M.<br>
 --000e0cd242c682927c046d8cfe82-- 




Follow ups

References