🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c
Article #313

Re: will it be optimized?

#313
From: chine.bleu
Date: Tue, 13 Oct 2026 08:27
45 lines
2436 bytes
fir wrote:
> inline void MoveObject3D(Object3D *o)
> {
>      Object3D a=*o;
>
>      float dt=0.01f;
>
>      if(a.type!='ship') return;

Bad idea a.field = 1 changes a local variable
o->field = 2 changes a distant variable
Unless you are very good with your interface contracts this can lead to 
long tedious pointer chasing debugs.

Alternatively run your source through a filter like tr so you xcan use 
more expressive characters

	¬	!
	≤	<=
	≥	>=
	≠	!=
	→	->
	=	==
	:==	=
	:=	=

et cetera

 > inline void MoveObject3D(Object3D *o)
 >      float dt:=0.01f;
 >      if(o→type≠'ship') return;
>    if(frame_number%5=0)
>     {
>         Position p:=o→p; BagAdd(&p,'deb',500); return;
>     }
>     float3 b:=o→p.pos;
>     float dist:=length(b);
>     o→maneuver_time-:=dt;
>     if(o→maneuver_time≤0)

-- 
Siri Seal of Disavowal #777-000. Disavowed. Denied.  @
NO KINGS    For I desire mercy not sacrifice.       /|\
The Church of the Holey Apple .signature 5.5        / \
of Discordian Mysteries. This post insults Islam. Mohamed
Technical Details
Message-ID: <11akq1p$bv9i$1@dont-email.me>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
References: <11a1f4c$1g3sg$1@dont-email.me> <11a26lp$1lqal$2@dont-email.me> <11a29kt$1nuah$1@dont-email.me>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From: "chine.bleu" <chine.bleu@yahoo.com>
Newsgroups: comp.lang.c
Subject: Re: will it be optimized?
Date: Tue, 13 Oct 2026 01:27:38 -0700
Organization: semi-chaotic
Lines: 45
Message-ID: <11akq1p$bv9i$1@dont-email.me>
References: <11a1f4c$1g3sg$1@dont-email.me> <11a26lp$1lqal$2@dont-email.me> <11a29kt$1nuah$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 13 Oct 2026 08:27:38 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="392498"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX190kKTc1cGm0t1JENSLIojXCNROXgw2ROw="; posting-host="d5e890c59907eaf254c24f4a19db3603"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:32.0) Gecko/20100101 Firefox/32.0 SeaMonkey/2.29.1
Cancel-Lock: sha1:P/oU7WeTi++77hrRRaomLDZ7ITM= sha256:3ACVv9/rn4RWwom6EXVDmXWfCBtRVKcekhfINy9vJnI=
	sha1:UbItWWHppfoWuw0IAVM54dXQpb0= sha256:MzROUZc79bSgrN8EJrpPMlgnmCfKK8ND1Csary+5vI0=
In-Reply-To: <11a29kt$1nuah$1@dont-email.me>