[FFmpeg-devel] _t POSIX namespace issues

Måns Rullgård mans
Thu Dec 11 10:43:02 CET 2008


Diego Biurrun <diego at biurrun.de> writes:

> So names ending in _t are reserved by POSIX.  Nonetheless we have tons
> of them.  I thought about fixing these issues myself, but coming up with
> good new names is tedious, so I propose to have each maintainer address
> the problem in the files they maintain.  Here is a the result of a grep
> for problematic names with maintainers, in no particular order:

In most cases simply dropping the _t from the name is suitable.

> Roman Shaposhnik:
> libavcodec/pthread.c:    pthread_cond_t current_job_cond;
> libavcodec/pthread.c:    pthread_cond_t last_job_cond;
> libavcodec/pthread.c:    pthread_mutex_t current_job_lock;
> libavcodec/pthread.c:    pthread_t *workers;

pthread_*_t are POSIX types.

> Michael Niedermayer:
> libavcodec/h263.c:        if(qp_t)
> libavcodec/huffyuv.c:} heap_elem_t;
> libavcodec/libxvid_rc.c:    xvid_plg_create_t xvid_plg_create;
> libavcodec/libxvid_rc.c:    xvid_plg_data_t xvid_plg_data;
> libavcodec/libxvid_rc.c:    xvid_plg_destroy_t xvid_plg_destroy;

Those are probably defined by the xvid headers.  Not much we can do
about that.

> libpostproc/postprocess.h:typedef void pp_context_t;
> libpostproc/postprocess.h:typedef void pp_mode_t;

Typedeffing things as void or void * is just silly.

> Anuradha Suraparaju:
> libavcodec/libdiracdec.c:    dirac_decoder_t* p_decoder;
> libavcodec/libdiracdec.c:            dirac_sourceparams_t *src_params =
> libavcodec/libdiracenc.c:    dirac_encoder_context_t enc_ctx;
> libavcodec/libdiracenc.c:    dirac_encoder_state_t state;
> libavcodec/libdiracenc.c:    dirac_encoder_t* p_encoder;
> libavcodec/libdirac.h:    dirac_chroma_t dirac_pix_fmt;

Library fault again.

> unmaintained:
> libavcodec/libxvidff.c:static int xvid_ff_2pass_create(xvid_plg_create_t * param,
> libavcodec/libxvidff.c:} xvid_context_t;
> libavcodec/libxvidff.c:    xvid_enc_create_t xvid_enc_create;
> libavcodec/libxvidff.c:    xvid_enc_frame_t xvid_enc_frame;
> libavcodec/libxvidff.c:    xvid_enc_plugin_t plugins[7];
> libavcodec/libxvidff.c:    xvid_enc_stats_t xvid_enc_stats;
> libavcodec/libxvidff.c:    xvid_gbl_init_t xvid_gbl_init;
> libavcodec/libxvidff.c:                                xvid_plg_data_t *param) {
> libavcodec/libxvidff.c:                                xvid_plg_destroy_t *param) {
> libavcodec/libxvidff.c:    xvid_plugin_single_t single;

And again.

> libavformat/os_support.h:typedef unsigned long nfds_t;

That is a replacement for a missing system type, so it's OK.

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-devel mailing list