~ubuntu-branches/debian/sid/mame/sid

« back to all changes in this revision

Viewing changes to src/lib/lib7z/7zBuf.c

  • Committer: Package Import Robot
  • Author(s): Jordi Mallach, Emmanuel Kasper, Jordi Mallach
  • Date: 2012-06-05 20:02:23 UTC
  • mfrom: (0.3.1) (0.1.4)
  • Revision ID: package-import@ubuntu.com-20120605200223-gnlpogjrg6oqe9md
Tags: 0.146-1
[ Emmanuel Kasper ]
* New upstream release
* Drop patch to fix man pages section and patches to link with flac 
  and jpeg system lib: all this has been pushed upstream by Cesare Falco
* Add DM-Upload-Allowed: yes field.

[ Jordi Mallach ]
* Create a "gnu" TARGETOS stanza that defines NO_AFFINITY_NP.
* Stop setting TARGETOS to "unix" in d/rules. It should be autodetected,
  and set to the appropriate value.
* mame_manpage_section.patch: Change mame's manpage section to 6 (games),
  in the TH declaration.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* 7zBuf.c -- Byte Buffer
 
2
2008-03-28
 
3
Igor Pavlov
 
4
Public domain */
 
5
 
 
6
#include "7zBuf.h"
 
7
 
 
8
void Buf_Init(CBuf *p)
 
9
{
 
10
  p->data = 0;
 
11
  p->size = 0;
 
12
}
 
13
 
 
14
int Buf_Create(CBuf *p, size_t size, ISzAlloc *alloc)
 
15
{
 
16
  p->size = 0;
 
17
  if (size == 0)
 
18
  {
 
19
    p->data = 0;
 
20
    return 1;
 
21
  }
 
22
  p->data = (Byte *)alloc->Alloc(alloc, size);
 
23
  if (p->data != 0)
 
24
  {
 
25
    p->size = size;
 
26
    return 1;
 
27
  }
 
28
  return 0;
 
29
}
 
30
 
 
31
void Buf_Free(CBuf *p, ISzAlloc *alloc)
 
32
{
 
33
  alloc->Free(alloc, p->data);
 
34
  p->data = 0;
 
35
  p->size = 0;
 
36
}