Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Piotr Kalinowski Newsgroups: comp.lang.c Subject: Re: Casts on lvalues Date: Wed, 05 Dec 2012 16:07:40 +0100 Organization: A noiseless patient Spider Lines: 24 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx04.eternal-september.org; posting-host="1a09fb6db84db8196e17f0b17d92738a"; logging-data="5117"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18/TNiwtEqORAYNqZ7JPjML" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (darwin) Cancel-Lock: sha1:X6D9n8I109nGo5FJj+eGCEfeP5E= sha1:iLMlkFib2jLlIckQvxm/6TDnoHc= Xref: csiph.com comp.lang.c:28946 "BartC" writes: > "Edward A. Falk" wrote in message > news:k9m2m6$vfu$1@blue-new.rahul.net... > I've already said elsewhere that using an object rather than a byte > offset involved an unnecessary multiplication or shift. It was not unnecessary. It's called pointer arithmetic and allowed you to use more elegant code at slightly higher level of abstraction that is supposed to more closely represent your intentions. You have decided this abstraction is unnecessary, because you feel you need to optimise this shift/multiplication away (and maybe you do, I couldn't possibly know that). More specifically, you have implicitly decided this optimisation is worth the trade off in form of increased complexity of the code (decreased readability or whatever it is that bugged you enough to actually ask about it, seeking a different way to express what you are doing). There's no free lunch. Now deal with the consequences, or revert your decision, as others already presented answer to your original question. Regards, Piotr Kalinowski