File: remove_unnecessary_libdeps.patch

package info (click to toggle)
blockout2 2.5%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,240 kB
  • sloc: cpp: 10,786; ansic: 148; makefile: 126
file content (99 lines) | stat: -rw-r--r-- 2,118 bytes parent folder | download | duplicates (2)
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
--- a/ImageLib/src/CImage.cpp
+++ b/ImageLib/src/CImage.cpp
@@ -4,10 +4,10 @@
 /*            Use an ultra fast compression method */
 /***************************************************/
 #include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
 
 #include "CImage.h"
-#include "gif/gif.h"
-#include "jpg/jpegdecoder.h"
 #include "png/hpng.h"
 
 #ifdef WINDOWS
@@ -50,55 +50,6 @@
 	return 0;
   }
 
-  // Load GIF image
-  if( strcasecmp(ext,"gif")==0 ) {
-
-    GIF_IMAGE img;
-	int  Length;
-
-	strcpy(img.FileName,FileName);
-	if( !LoadGifImage(&img) ) {
-	  strcpy(m_LastError,GifErrorMessage);
-	  return 0;	
-	}
-
-    m_Width=img.width;
-    m_Height=img.height;	
-	Length=m_Width*m_Height;
-
-	m_Data=(BYTE *)malloc( Length*3 );
-
-	for(int i=0,j=0;i<Length;i++,j+=3) {
-	  m_Data[j+0] = (BYTE)( img.Blue[   (BYTE)img.data[i] ] );
-	  m_Data[j+1] = (BYTE)( img.Green[ (BYTE)img.data[i] ] );
-	  m_Data[j+2] = (BYTE)( img.Red[  (BYTE)img.data[i] ] );
-	}
-
-	free(img.data);
-
-	return 1;
-      
-  }
-
-  // Load JPG image
-  if( strcasecmp(ext,"jpg")==0 || strcasecmp(ext,"jpeg")==0 ) {
-
-    JPEG_IMAGE img;
-
-	strcpy(img.FileName,FileName);
-	if( !LoadJpegImage(&img) ) {
-	  strcpy(m_LastError,JpegErrorMessage);
-	  return 0;	
-	}
-
-    m_Width=img.width;
-    m_Height=img.height;	
-	m_Data=(BYTE *)img.data;
-
-	return 1;
-      
-  }
-
   // Load PNG image
   if( strcasecmp(ext,"png")==0 ) {
 
--- a/ImageLib/src/png/hpng.c
+++ b/ImageLib/src/png/hpng.c
@@ -1,7 +1,7 @@
 #include <malloc.h>
 #include <math.h>
 #include <string.h>
-#include "png/png.h"
+#include <libpng12/png.h>
 #include "hpng.h"
 
 char PngErrorMessage[1024];
@@ -100,8 +100,8 @@
 
 	// Convert the image
 	{
-	  unsigned char *src = data;
-	  unsigned char *dst = (unsigned char *)malloc(width*height*3);
+	  char *src = data;
+	  char *dst = (char *)malloc(width*height*3);
 	  d->data = dst;
 	  for(i = 0 ; i < height ; i++) {
 	    for(j = 0 ; j < width ; j++) {
@@ -192,5 +192,4 @@
 
    /* that's it */
    return NULL;
-
 }