Commit f7a2a7f8 authored by Stephane Ragot's avatar Stephane Ragot
Browse files

fix clang and warning

parent 60eb41db
Loading
Loading
Loading
Loading
Loading
+11 −9
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ struct IVAS_RTP_FILE
    FILE *f_rtpstream;
};

static bool file_exists( char *filename )
static bool file_exists( const char *filename )
{
    struct stat buffer;
    return ( stat( filename, &buffer ) == 0 );
@@ -55,17 +55,19 @@ static ivas_error IvasRtpFile_Open(
    IVAS_RTP_FILE_HANDLE *phRtpFile /* o : pointer to an IVAS file reader handle */
)
{
    const char *mode;
    FILE *f_rtpstream;

    if ( file_exists( filePath ) )
    {
        mode = isFileWriter ? "ab" : "rb";
        char *mode = isFileWriter ? "ab" : "rb";
        fprintf( stderr, "Warning: Rtp file %s already exists, opening in append mode\n", filePath );
        f_rtpstream = fopen( filePath, mode );
    }
    else
    {
        mode = isFileWriter ? "wb" : "rb";
        char *mode = isFileWriter ? "wb" : "rb";
        f_rtpstream = fopen( filePath, mode );
    }
    FILE *f_rtpstream = fopen( filePath, mode );
    if ( f_rtpstream == NULL )
    {
        return IVAS_ERROR( IVAS_ERR_FAILED_FILE_OPEN, "could not open: %s\n", filePath );
+1 −1

File changed.

Contains only whitespace changes.