linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Scott <drmemory@3rivers.net>
To: linux-c-programming@vger.kernel.org
Subject: Re: Initializer element is not constant
Date: Mon, 24 Jan 2005 13:44:38 -0700	[thread overview]
Message-ID: <20050124204438.GB833@drmemory.local> (raw)
In-Reply-To: <20050122211206.GC12029@opaque>

On Sat, Jan 22, 2005 at 10:12:06PM +0100, Christoph Bussenius wrote:
> I am not quite sure what you intend to do, but I guess that you want
> namectrl to change when you change recip_data[0].  To accomplish this,
> you could make recip_data[0] a pointer to a pointer:
> 
> char *namectrl = NULL;
> char *name1 = NULL;
> char *name2 = NULL;
> 
> typedef struct {
>         char **var;      /* destination for storage of the data */
>         size_t len;     /* max len of the data */
>         char *(*xlat)();        /* translation routine */
> } DATUM;                                                                                        
> 
> DATUM recip_data[] = {
> {  &namectrl, NAMECTRL_LEN, make_upper },
> {  &name1, NAME1_LEN, make_upper },
> {  &name2, NAME2_LEN, make_upper },
> [...]
> 

Right! As I said, my c is quite rusty. Now as I recall, there was some
problem with the old dos compiler which prevented this syntax but
allowed the erroneous one. That, or I didn't understand what I was
doing and the compiler let me get away with it.... Looking at the code
in more detail, I see that it relies upon some bcd math module I'd written
in assembler, so the odds of this getting ported are pretty
slim. Thanks for the help, though!

Scott Swanson


  reply	other threads:[~2005-01-24 20:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-20 23:21 Initializer element is not constant Scott
     [not found] ` <41F06AC1.2000605@hq.ntsp.nec.co.jp>
2005-01-21  2:37   ` Ron Michael Khu
2005-01-21 16:27     ` Scott
2005-01-21 17:46       ` Ron Michael Khu
2005-01-21 18:54         ` Scott
2005-01-21 19:50           ` Ron Michael Khu
2005-01-21 21:31             ` Scott
2005-01-22 21:12               ` Christoph Bussenius
2005-01-24 20:44                 ` Scott [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-01-24 21:09 Huber, George K RDECOM CERDEC STCD SRI
2005-01-24 21:28 ` Scott

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050124204438.GB833@drmemory.local \
    --to=drmemory@3rivers.net \
    --cc=linux-c-programming@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).