c9469b64fc3933d0565ffba8a45be8a39df6b927
Stefan Schuermans cleanup file headers after...

Stefan Schuermans authored 13 years ago

BlinkenLib/Tools.c  1) /* BlinkenLib
Stefan Schuermans update email address of author

Stefan Schuermans authored 10 years ago

BlinkenLib/Tools.c  2)    Copyright 2004-2014 Stefan Schuermans <stefan@schuermans.info>
Stefan Schuermans cleanup file headers after...

Stefan Schuermans authored 13 years ago

BlinkenLib/Tools.c  3)    Copyleft GNU public license - http://www.gnu.org/copyleft/gpl.html
BlinkenLib/Tools.c  4)    a blinkenarea.org project */
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

Tools.c             5) 
Tools.c             6) #include <stdlib.h>
Tools.c             7) 
Stefan Schuermans restructure directories

Stefan Schuermans authored 5 years ago

src/Tools.c         8) #include "Tools.h"
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

Tools.c             9) 
Stefan Schuermans adaptions for usage in C++

Stefan Schuermans authored 13 years ago

BlinkenLib/Tools.c 10) void *BlinkenMalloc1D(int count1, int size)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

Tools.c            11) {
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/Tools.c 12)   if (count1 < 1)
BlinkenLib/Tools.c 13)     count1 = 1;
BlinkenLib/Tools.c 14)   if (size < 1)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

Tools.c            15)     return NULL;
Tools.c            16) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/Tools.c 17)   return malloc(count1 * size);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

Tools.c            18) }
Tools.c            19) 
Stefan Schuermans adaptions for usage in C++

Stefan Schuermans authored 13 years ago

BlinkenLib/Tools.c 20) void **BlinkenMalloc2D(int count1, int count2, int size)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

Tools.c            21) {
Tools.c            22)   int sz, i;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/Tools.c 23)   char *p;
BlinkenLib/Tools.c 24)   void **ptr;
BlinkenLib/Tools.c 25) 
BlinkenLib/Tools.c 26)   if (count1 < 1)
BlinkenLib/Tools.c 27)     count1 = 1;
BlinkenLib/Tools.c 28)   if (count2 < 1)
BlinkenLib/Tools.c 29)     count2 = 1;
BlinkenLib/Tools.c 30)   if (size < 1)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

Tools.c            31)     return NULL;
Tools.c            32) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/Tools.c 33)   sz = count1 * sizeof(void *) + count1 * count2 * size;
BlinkenLib/Tools.c 34)   p = (char *)malloc(sz);
BlinkenLib/Tools.c 35)   if (p == NULL)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

Tools.c            36)     return NULL;
Tools.c            37) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/Tools.c 38)   ptr = (void **)p;
BlinkenLib/Tools.c 39)   p += count1 * sizeof(void *);
BlinkenLib/Tools.c 40)   for (i = 0; i < count1; i++) {