libfreerdp-utils/stream: fix code style.

This commit is contained in:
Vic Lee 2011-07-10 17:27:21 +08:00
parent 49d7fd81a0
commit bea0e09e02
2 changed files with 10 additions and 12 deletions

View File

@ -27,16 +27,16 @@
struct _STREAM struct _STREAM
{ {
int size; int size;
uint8 * p; uint8* p;
uint8 * data; uint8* data;
}; };
typedef struct _STREAM STREAM; typedef struct _STREAM STREAM;
STREAM* stream_new(int size); STREAM* stream_new(int size);
void stream_free(STREAM * stream); void stream_free(STREAM* stream);
void void
stream_extend(STREAM * stream); stream_extend(STREAM* stream);
#define stream_check_size(_s,_n) \ #define stream_check_size(_s,_n) \
while (_s->p - _s->data + (_n) > _s->size) \ while (_s->p - _s->data + (_n) > _s->size) \
stream_extend(_s) stream_extend(_s)
@ -50,6 +50,7 @@ stream_extend(STREAM * stream);
#define stream_get_head(_s) _s->data #define stream_get_head(_s) _s->data
#define stream_get_tail(_s) _s->p #define stream_get_tail(_s) _s->p
#define stream_get_length(_s) (_s->p - _s->data) #define stream_get_length(_s) (_s->p - _s->data)
#define stream_get_data(_s) (_s->data)
#define stream_get_size(_s) (_s->size) #define stream_get_size(_s) (_s->size)
#define stream_read_uint8(_s, _v) do { _v = *_s->p++; } while (0) #define stream_read_uint8(_s, _v) do { _v = *_s->p++; } while (0)

View File

@ -24,12 +24,11 @@
#include <freerdp/utils/memory.h> #include <freerdp/utils/memory.h>
#include <freerdp/utils/stream.h> #include <freerdp/utils/stream.h>
STREAM * STREAM* stream_new(int size)
stream_new(int size)
{ {
STREAM * stream; STREAM* stream;
stream = (STREAM *) xmalloc(sizeof(STREAM)); stream = (STREAM*)xmalloc(sizeof(STREAM));
if (stream != NULL) if (stream != NULL)
{ {
@ -50,8 +49,7 @@ stream_new(int size)
return stream; return stream;
} }
void void stream_free(STREAM* stream)
stream_free(STREAM * stream)
{ {
if (stream != NULL) if (stream != NULL)
{ {
@ -60,8 +58,7 @@ stream_free(STREAM * stream)
} }
} }
void void stream_extend(STREAM* stream)
stream_extend(STREAM * stream)
{ {
int pos; int pos;