summaryrefslogtreecommitdiff
path: root/multimedia/vic/files/patch-histtolut.cpp
blob: c47168d31e64995ebfaf557355af61d475535f70 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
--- render/histtolut/histtolut.cpp.orig	Thu Jan 23 18:13:08 2003
+++ render/histtolut/histtolut.cpp	Thu Jan 23 18:15:11 2003
@@ -62,6 +62,7 @@
 #endif
 #include <sys/stat.h>
 #include <fcntl.h>
+#include <cstring>
 
 #ifdef WIN32
 extern "C" {
@@ -142,7 +143,7 @@
  * For further details see "Introduction to Algorithms" by Carmen,
  * Lieserson and Rivest.
  */
-//extern void *memset(void *, int, size_t);
+//extern void *std::memset(void *, int, size_t);
 
 /* XXX should pass backup array in as argument, that way can create it
    only once. */
@@ -154,7 +155,7 @@
  \
 	register histItem** hist = &h[idx]; \
 	int j; \
-	memset((void *)aux, 0, 256 * sizeof(int)); \
+	std::memset((void *)aux, 0, 256 * sizeof(int)); \
 	for (j = 0; j < n; j++) \
 		aux[hist[j]->c.fld]++; \
 	 \
@@ -199,7 +200,7 @@
 	box* bv = new box[sizeof(box) * newcolors];
 
 	register u_char* colormap = cmap;
-	memset(colormap, 0, 3 * newcolors);
+	std::memset(colormap, 0, 3 * newcolors);
 
 	/* Set up the initial box. */
 	bv[0].ind = 0;
@@ -450,7 +451,7 @@
 	box* bv = new box[sizeof(box) * newcolors];
 
 	register u_char* colormap = cmap;
-	memset(colormap, 0, 3 * newcolors);
+	std::memset(colormap, 0, 3 * newcolors);
 
 	/* Set up the initial box. */
 	bv[0].ind = 0;
@@ -639,7 +640,7 @@
 		abort();
 
 	int ncol[MAX_YLEVELS];
-	memset(ncol, 0, sizeof(ncol));
+	std::memset(ncol, 0, sizeof(ncol));
 	/* 
 	 * We do this in two passes so that the size of the table can be 
 	 * calculated.  Otherwise it would be have to be too big:
@@ -657,7 +658,7 @@
 		table[i] = new histItem[ncol[i]];
 
 	i = 0;
-	memset(ncol, 0, sizeof(ncol));
+	std::memset(ncol, 0, sizeof(ncol));
 	for (v = 0; v < 1 << 5; ++v) {
 		for (int u = 0; u < 1 << 5; ++u) {
 			for (int y = 0; y < 1 << 4; ++y) {
@@ -688,7 +689,7 @@
 	}
 
 	histItem** histogram[MAX_YLEVELS];
-	memset(histogram, 0, sizeof(histogram));
+	std::memset(histogram, 0, sizeof(histogram));
 	int totcol = 0;
 	for (i = 0; i < ny; ++i) {
 		if (ncol[i] != 0) {