File: cooked_ioctl.diff

package info (click to toggle)
libtritonus-java 20070428-8
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 6,952 kB
  • ctags: 11,916
  • sloc: ansic: 53,816; java: 45,226; sh: 3,022; makefile: 1,188; xml: 820; cpp: 147
file content (110 lines) | stat: -rw-r--r-- 4,280 bytes parent folder | download | duplicates (8)
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
100
101
102
103
104
105
106
107
108
109
110
Index: libtritonus-java-20070428/src/lib/cooked_ioctl/org_tritonus_lowlevel_cdda_cooked_ioctl_CookedIoctl.cc
===================================================================
--- libtritonus-java-20070428.orig/src/lib/cooked_ioctl/org_tritonus_lowlevel_cdda_cooked_ioctl_CookedIoctl.cc	2007-04-29 13:11:17.000000000 +0200
+++ libtritonus-java-20070428/src/lib/cooked_ioctl/org_tritonus_lowlevel_cdda_cooked_ioctl_CookedIoctl.cc	2007-04-29 13:26:32.000000000 +0200
@@ -10,15 +10,15 @@
 #include	<sys/ioctl.h>
 
 #include	"../common/common.h"
-#include	"../common/HandleFieldHandler.hh"
-#include	"org_tritonus_lowlevel_cdda_cooked_0005fioctl_CookedIoctl.h"
+#include	"../common/HandleFieldHandler.h"
+#include	"org_tritonus_lowlevel_cdda_cooked_ioctl_CookedIoctl.h"
 
 
 
 static int	DEBUG = 0;
 static FILE*	debug_file = NULL;
 
-static HandleFieldHandler<int>	handler;
+HandleFieldHandlerDeclaration(handler,int);
 
 
 
@@ -42,7 +42,7 @@
 	{
 		return -errno;
 	}
-	handler.setHandle(env, obj, cdrom_fd);
+	setHandle(env, obj, cdrom_fd);
 	if (DEBUG) { fprintf(debug_file, "Java_org_tritonus_lowlevel_cdda_cooked_1ioctl_CookedIoctl_open(): end\n"); }
 	return 0;
 }
@@ -61,7 +61,7 @@
 	int	fd;
 
 	if (DEBUG) { fprintf(debug_file, "Java_org_tritonus_lowlevel_cdda_cooked_1ioctl_CookedIoctl_close(): begin\n"); }
-	fd = handler.getHandle(env, obj);
+	fd = getHandle(env, obj);
 	close(fd);
 	if (DEBUG) { fprintf(debug_file, "Java_org_tritonus_lowlevel_cdda_cooked_1ioctl_CookedIoctl_close(): end\n"); }
 }
@@ -89,14 +89,14 @@
 	int		i;
 
 	if (DEBUG) { fprintf(debug_file, "Java_org_tritonus_lowlevel_cdda_cooked_1ioctl_CookedIoctl_readTOC(): begin\n"); }
-	cdrom_fd = handler.getHandle(env, obj);
+	cdrom_fd = getHandle(env, obj);
 	nReturn = ioctl(cdrom_fd, CDROMREADTOCHDR, &toc_hdr);
 	if (nReturn < 0)
 	{
 		throwRuntimeException(env, "CookedIoctl: read TOC header ioctl failed");
 	}
 	checkArrayLength(env, anValues, 2);
-	pnValues = env->GetIntArrayElements(anValues, NULL);
+	pnValues = (*env)->GetIntArrayElements(env, anValues, NULL);
 	if (pnValues == NULL)
 	{
 		throwRuntimeException(env, "GetIntArrayElements failed");
@@ -105,16 +105,16 @@
 	pnValues[1] = toc_hdr.cdth_trk1;
 	nFirstTrack = toc_hdr.cdth_trk0;
 	nLastTrack = toc_hdr.cdth_trk1;
-	env->ReleaseIntArrayElements(anValues, pnValues, 0);
+	(*env)->ReleaseIntArrayElements(env, anValues, pnValues, 0);
 
 	checkArrayLength(env, anStartFrame, 100);
-	pnStartFrame = env->GetIntArrayElements(anStartFrame, NULL);
+	pnStartFrame = (*env)->GetIntArrayElements(env, anStartFrame, NULL);
 	if (pnStartFrame == NULL)
 	{
 		throwRuntimeException(env, "GetIntArrayElements failed");
 	}
 	checkArrayLength(env, anType, 100);
-	pnType = env->GetIntArrayElements(anType, NULL);
+	pnType = (*env)->GetIntArrayElements(env, anType, NULL);
 	if (pnType == NULL)
 	{
 		throwRuntimeException(env, "GetIntArrayElements failed");
@@ -143,8 +143,8 @@
 	pnStartFrame[nLastTrack - nFirstTrack + 1] = toc_entry.cdte_addr.lba;
 	pnType[nLastTrack - nFirstTrack + 1] = toc_entry.cdte_ctrl&CDROM_DATA_TRACK;
 
-	env->ReleaseIntArrayElements(anStartFrame, pnStartFrame, 0);
-	env->ReleaseIntArrayElements(anType, pnType, 0);
+	(*env)->ReleaseIntArrayElements(env, anStartFrame, pnStartFrame, 0);
+	(*env)->ReleaseIntArrayElements(env, anType, pnType, 0);
 
 	if (DEBUG) { fprintf(debug_file, "Java_org_tritonus_lowlevel_cdda_cooked_1ioctl_CookedIoctl_readTOC(): end\n"); }
 	return 0;
@@ -167,9 +167,9 @@
 	jbyte*		pbData;
 	
 	if (DEBUG) { fprintf(debug_file, "Java_org_tritonus_lowlevel_cdda_cooked_1ioctl_CookedIoctl_readFrame(): begin\n"); }
-	cdrom_fd = handler.getHandle(env, obj);
+	cdrom_fd = getHandle(env, obj);
 	checkArrayLength(env, abData, CD_FRAMESIZE_RAW * nCount);
-	pbData = env->GetByteArrayElements(abData, NULL);
+	pbData = (*env)->GetByteArrayElements(env, abData, NULL);
 	if (pbData == NULL)
 	{
 		throwRuntimeException(env, "GetIntArrayElements failed");
@@ -183,7 +183,7 @@
 	{
 		throwRuntimeException(env, "CookedIoctl: read raw ioctl failed");
 	}
-	env->ReleaseByteArrayElements(abData, pbData, 0);
+	(*env)->ReleaseByteArrayElements(env, abData, pbData, 0);
 	if (DEBUG) { fprintf(debug_file, "Java_org_tritonus_lowlevel_cdda_cooked_1ioctl_CookedIoctl_readFrame(): end\n"); }
 	return 0;
 }