# HG changeset patch # User Matti Hamalainen # Date 1425321025 -7200 # Node ID 988a3397839e72be33286c8989495cda61a7274c # Parent e0fb6fa1c6894890d13ce3614364fa744c0b3a82 Move functions around for saner order. diff -r e0fb6fa1c689 -r 988a3397839e src/dmbstr.c --- a/src/dmbstr.c Mon Mar 02 20:28:25 2015 +0200 +++ b/src/dmbstr.c Mon Mar 02 20:30:25 2015 +0200 @@ -7,12 +7,6 @@ #include "dmbstr.h" -static BOOL dmPutByteFILE(DMBitStreamContext *ctx, const Uint8 val) -{ - return fputc(val, (FILE *) ctx->fp) == val; -} - - void dmInitBitStreamContext(DMBitStreamContext *ctx) { ctx->outBuf = 0; @@ -21,20 +15,6 @@ } -int dmInitBitStreamFILE(DMBitStreamContext *ctx, FILE *fp) -{ - if (ctx == NULL || fp == NULL) - return DMERR_NULLPTR; - - ctx->putByte = dmPutByteFILE; - ctx->fp = (void *) fp; - - dmInitBitStreamContext(ctx); - - return DMERR_OK; -} - - BOOL dmPutBits(DMBitStreamContext *ctx, const int val, const int n) { int i; @@ -74,3 +54,23 @@ return 0; } + + +static BOOL dmPutByteFILE(DMBitStreamContext *ctx, const Uint8 val) +{ + return fputc(val, (FILE *) ctx->fp) == val; +} + + +int dmInitBitStreamFILE(DMBitStreamContext *ctx, FILE *fp) +{ + if (ctx == NULL || fp == NULL) + return DMERR_NULLPTR; + + ctx->putByte = dmPutByteFILE; + ctx->fp = (void *) fp; + + dmInitBitStreamContext(ctx); + + return DMERR_OK; +}