sox-devel@lists.sourceforge.net unofficial mirror
 help / color / mirror / code / Atom feed
* stdint
@ 2020-08-21 21:16 Jan Stary
  2020-08-21 22:05 ` stdint Måns Rullgård
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Stary @ 2020-08-21 21:16 UTC (permalink / raw)
  To: Måns Rullgård; +Cc: sox-devel

The latest commit says

    All modern systems, even msvc, have the C99 stdint.h integer types.
    Replace the guesswork with typedefs using these types.  This fixes
    numerous warnings on some system where both long and long long are
    64-bit.

and replaces e.g. the following attrocity

  #if SCHAR_MAX==127 && SCHAR_MIN==(-128)
  typedef signed char sox_int8_t;
  #elif CHAR_MAX==127 && CHAR_MIN==(-128)
  typedef char sox_int8_t;
  #else
  #error Unable to determine an appropriate definition for sox_int8_t.
  #endif

with

  typedef int8_t sox_int8_t;

But why typedef standard int types such as int8_t at all?
Why does the code use sox_int8_t (being a typedef of int8_t)
instead of simply using int8_t, as defined in stdint.h?

Jan



_______________________________________________
SoX-devel mailing list
SoX-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: stdint
  2020-08-21 21:16 stdint Jan Stary
@ 2020-08-21 22:05 ` Måns Rullgård
  0 siblings, 0 replies; 2+ messages in thread
From: Måns Rullgård @ 2020-08-21 22:05 UTC (permalink / raw)
  To: Jan Stary; +Cc: sox-devel

Jan Stary <hans@stare.cz> writes:

> The latest commit says
>
>     All modern systems, even msvc, have the C99 stdint.h integer types.
>     Replace the guesswork with typedefs using these types.  This fixes
>     numerous warnings on some system where both long and long long are
>     64-bit.
>
> and replaces e.g. the following attrocity
>
>   #if SCHAR_MAX==127 && SCHAR_MIN==(-128)
>   typedef signed char sox_int8_t;
>   #elif CHAR_MAX==127 && CHAR_MIN==(-128)
>   typedef char sox_int8_t;
>   #else
>   #error Unable to determine an appropriate definition for sox_int8_t.
>   #endif
>
> with
>
>   typedef int8_t sox_int8_t;
>
> But why typedef standard int types such as int8_t at all?
> Why does the code use sox_int8_t (being a typedef of int8_t)
> instead of simply using int8_t, as defined in stdint.h?

SoX predates stdint.h.  It made sense once upon a time.  We can get rid
of those typedefs, but since libsox users might be relying on them, we
should give them a chance to update their code before simply deleting
them.  All in good time.

-- 
Måns Rullgård


_______________________________________________
SoX-devel mailing list
SoX-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-08-21 22:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-21 21:16 stdint Jan Stary
2020-08-21 22:05 ` stdint Måns Rullgård

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/sox.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).