codyopel / mp4v2

Automatically exported from code.google.com/p/mp4v2
Other
0 stars 0 forks source link

Fix compiler warnings under gcc #46

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
We use gcc in "strict" mode per our coding standards.  In this mode, one
minor issue in mp4v2 gets flagged:

/** Enumeration of file modes for custom file provider. */
typedef enum MP4FileMode_e
{
    FILEMODE_UNDEFINED, /**< undefined */
    FILEMODE_READ,      /**< file may be read */
    FILEMODE_MODIFY,    /**< file may be read/written */
    FILEMODE_CREATE,    /**< file will be created/truncated for read/write */
} MP4FileMode;

The issue is the trailing common after FILEMODE_CREATE.  It needs to be:

/** Enumeration of file modes for custom file provider. */
typedef enum MP4FileMode_e
{
    FILEMODE_UNDEFINED, /**< undefined */
    FILEMODE_READ,      /**< file may be read */
    FILEMODE_MODIFY,    /**< file may be read/written */
    FILEMODE_CREATE    /**< file will be created/truncated for read/write */
} MP4FileMode;

Here are the guys with trailing commas:

/** Enumeration of file modes for custom file provider. */
typedef enum MP4FileMode_e
{
    FILEMODE_UNDEFINED, /**< undefined */
    FILEMODE_READ,      /**< file may be read */
    FILEMODE_MODIFY,    /**< file may be read/written */
    FILEMODE_CREATE,    /**< file will be created/truncated for read/write */
} MP4FileMode;

/** Enumeration of possible MP4TagArtwork::type values. */
typedef enum MP4TagArtworkType_e
{
    MP4_ART_UNDEFINED = 0,
    MP4_ART_BMP       = 1,
    MP4_ART_GIF       = 2,
    MP4_ART_JPEG      = 3,
    MP4_ART_PNG       = 4,
} MP4TagArtworkType;

/** Sample dependency types.
 *
 *  Bit combinations 0x03, 0x30, 0xc0 are reserved.
 */
typedef enum MP4SampleDependencyType_e {
    MP4_SDT_UNKNOWN                       = 0x00, /**< unknown */
    MP4_SDT_HAS_REDUNDANT_CODING          = 0x01, /**< contains redundant
coding */
    MP4_SDT_HAS_NO_REDUNDANT_CODING       = 0x02, /**< does not contain
redundant coding */
    MP4_SDT_HAS_DEPENDENTS                = 0x04, /**< referenced by other
samples */
    MP4_SDT_HAS_NO_DEPENDENTS             = 0x08, /**< not referenced by
other samples */
    MP4_SDT_IS_DEPENDENT                  = 0x10, /**< references other
samples */
    MP4_SDT_IS_INDEPENDENT                = 0x20, /**< does not reference
other samples */
    MP4_SDT_EARLIER_DISPLAY_TIMES_ALLOWED = 0x40, /**< subequent samples in
GOP may display earlier */
    _MP4_SDT_RESERVED                     = 0x80, /**< reserved */
} MP4SampleDependencyType;

/** Enumeration of file modes for custom file provider. */
typedef enum MP4FileMode_e
{
    FILEMODE_UNDEFINED, /**< undefined */
    FILEMODE_READ,      /**< file may be read */
    FILEMODE_MODIFY,    /**< file may be read/written */
    FILEMODE_CREATE,    /**< file will be created/truncated for read/write */
} MP4FileMode;

/** Enumeration of possible MP4TagArtwork::type values. */
typedef enum MP4TagArtworkType_e
{
    MP4_ART_UNDEFINED = 0,
    MP4_ART_BMP       = 1,
    MP4_ART_GIF       = 2,
    MP4_ART_JPEG      = 3,
    MP4_ART_PNG       = 4,
} MP4TagArtworkType;

/** Sample dependency types.
 *
 *  Bit combinations 0x03, 0x30, 0xc0 are reserved.
 */
typedef enum MP4SampleDependencyType_e {
    MP4_SDT_UNKNOWN                       = 0x00, /**< unknown */
    MP4_SDT_HAS_REDUNDANT_CODING          = 0x01, /**< contains redundant
coding */
    MP4_SDT_HAS_NO_REDUNDANT_CODING       = 0x02, /**< does not contain
redundant coding */
    MP4_SDT_HAS_DEPENDENTS                = 0x04, /**< referenced by other
samples */
    MP4_SDT_HAS_NO_DEPENDENTS             = 0x08, /**< not referenced by
other samples */
    MP4_SDT_IS_DEPENDENT                  = 0x10, /**< references other
samples */
    MP4_SDT_IS_INDEPENDENT                = 0x20, /**< does not reference
other samples */
    MP4_SDT_EARLIER_DISPLAY_TIMES_ALLOWED = 0x40, /**< subequent samples in
GOP may display earlier */
    _MP4_SDT_RESERVED                     = 0x80, /**< reserved */
} MP4SampleDependencyType;

It's a very minor issue, but it would be a big help to fix it.  ;)  Thanks!

Original issue reported on code.google.com by kid...@gmail.com on 8 Dec 2009 at 5:35

GoogleCodeExporter commented 8 years ago
Fixed.

Original comment by kid...@gmail.com on 2 Apr 2010 at 1:04