emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: About the new frame title


From: Eli Zaretskii
Subject: Re: About the new frame title
Date: Fri, 25 Sep 2020 15:41:36 +0300

> Date: Fri, 25 Sep 2020 14:38:44 +0200 (CEST)
> From: Angelo Graziosi <angelo.g0@libero.it>
> Cc: emacs-devel@gnu.org
> 
> > Does this work?  AFAIK, 'sizeof (char *)' returns 8 on a 64-bit system
> > and 4 on a 32-bit system, regardless of the length of the text string
> > it points to.
> 
> I wonder if this can fix it:
> 
> ptrdiff_t nbytes = strlen(title)*sizeof (title[0]);

This will work, but the idea was to compute the value at compile time,
since sizeof is a compile-time operator.

> or better, given 'title' is a const hard coded,
> 
> ptrdiff_t nbytes = 13*sizeof (title[0]);

That's exactly what I wanted to avoid, since the constant needs to be
updated each time the text is modified.

Thanks.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]