Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 82883 Details for
Bug 127233
pilot-link-0.12.0_pre4.ebuild (update)
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
pilot-link-0.12.0_pre4-java_fix.patch
pilot-link-0.12.0_pre4-java_fix.patch (text/plain), 7.12 KB, created by
Simon Ruggier
on 2006-03-22 14:00:52 UTC
(
hide
)
Description:
pilot-link-0.12.0_pre4-java_fix.patch
Filename:
MIME Type:
Creator:
Simon Ruggier
Created:
2006-03-22 14:00:52 UTC
Size:
7.12 KB
patch
obsolete
>diff -ur pilot-link-0.12.0-pre4/bindings/Java/Makefile.in pilot-link-0.12.0-pre4-r1/bindings/Java/Makefile.in >--- pilot-link-0.12.0-pre4/bindings/Java/Makefile.in 2006-03-22 15:30:42.000000000 -0500 >+++ pilot-link-0.12.0-pre4-r1/bindings/Java/Makefile.in 2006-03-22 15:33:15.000000000 -0500 >@@ -286,7 +286,6 @@ > org/gnu/pilotlink/ToDoRecord.class \ > org/gnu/pilotlink/Record.class \ > test.class \ >- tst/ftbtest.class \ > datebooktst.class \ > adrtest.class > >diff -ur pilot-link-0.12.0-pre4/bindings/Java/libjpisock.c pilot-link-0.12.0-pre4-r1/bindings/Java/libjpisock.c >--- pilot-link-0.12.0-pre4/bindings/Java/libjpisock.c 2004-12-20 11:09:09.000000000 -0500 >+++ pilot-link-0.12.0-pre4-r1/bindings/Java/libjpisock.c 2006-03-22 15:33:15.000000000 -0500 >@@ -88,13 +88,13 @@ > jclass jClass_appInfo = NULL; > jobject jObject_appInfo = NULL; > jmethodID jMethod_appInfo = NULL; >- jbyte * pBuffer = NULL; >+ pi_buffer_t* pBuffer = NULL; > int bProceed = 1; > int iNumBytesRead = 0; > > if (bProceed) { > /* Allocate memory for maximum data size */ >- pBuffer = (jbyte *)malloc(MAX_RESOURCE_SIZE); >+ pBuffer = pi_buffer_new(MAX_RESOURCE_SIZE); > if (pBuffer == NULL) { > postJavaException(env, > "org/gnu/pilotlink/PilotLinkException", >@@ -104,7 +104,7 @@ > } > if (bProceed) { > /* Read app-info block && verify successful read */ >- iNumBytesRead = dlp_ReadAppBlock(handle, db, 0, pBuffer, MAX_RESOURCE_SIZE); >+ iNumBytesRead = dlp_ReadAppBlock(handle, db, 0, MAX_RESOURCE_SIZE, pBuffer); > if (iNumBytesRead < 0) { > /* Throw Java exception, iNumBytesRead is actually an error code */ > postPilotLinkException(env, "Unable to read app-block", iNumBytesRead, errno); >@@ -129,11 +129,11 @@ > } > if (bProceed) { > jbyteArray jArray_buffer = env->NewByteArray(iNumBytesRead); >- env->SetByteArrayRegion(jArray_buffer, 0, (jint)iNumBytesRead, pBuffer); >+ env->SetByteArrayRegion(jArray_buffer, 0, (jint)iNumBytesRead, (jbyte *)pBuffer->data); > jObject_appInfo = env->NewObject(jClass_appInfo, jMethod_appInfo, jArray_buffer); > } > >- if (pBuffer != NULL) free(pBuffer); >+ if (pBuffer != NULL) pi_buffer_free(pBuffer); > return jObject_appInfo; > } > /* >@@ -561,11 +561,12 @@ > env->ReleaseStringUTFChars(jdbname, dbname); > if (dlp_OpenDB(handle,0,0x80|0x40,dbn,&db)<0) { > >- printf("Fehler!"); >+ printf("Fehler!\n"); > return NULL; > } > jbyte buff[0xffff]; >- int l=dlp_ReadAppBlock(handle,db,0,&buff,0xffff); >+ pi_buffer_t pbuff = {(unsigned char *) buff, 0xfff, 0}; >+ int l=dlp_ReadAppBlock(handle,db,0,0xffff,&pbuff); > printf("read app-Block of size %d\n",l); > fflush(stdout); > >@@ -659,13 +660,14 @@ > (JNIEnv *env, jobject obj, jint handle , jint db , jint idx) { > > jbyte buffer[MAX_RESOURCE_SIZE]; >+ pi_buffer_t pbuff = {(unsigned char *) buffer, MAX_RESOURCE_SIZE, 0}; > recordid_t id; >- jint size, attr, category; >+ jint attr, category; > //printf("Getting record..\n"); >- int ret = dlp_ReadRecordByIndex(handle, db, idx, buffer, >- &id, &size, &attr, &category); >- if (ret<0) { >- postPilotLinkException(env,"Error reading database by index",ret,errno); >+ int size = dlp_ReadRecordByIndex(handle, db, idx, &pbuff, >+ &id, &attr, &category); >+ if (size<0) { >+ postPilotLinkException(env,"Error reading database by index",size,errno); > return NULL; > } > //printf("getting class!\n"); >@@ -810,7 +812,6 @@ > int parent_sd = -1, /* Client socket, formerly sd */ > client_sd = -1, /* Parent socket, formerly sd2 */ > result; >- struct pi_sockaddr addr; > struct stat attr; > struct SysInfo sys_info; > const char *defport = "/dev/pilot"; >@@ -875,10 +876,7 @@ > /* > if (port != NULL) { > */ >- addr.pi_family = PI_AF_PILOT; >- strncpy(addr.pi_device, port, sizeof(addr.pi_device)); >- result = >- pi_bind(parent_sd, (struct sockaddr *) &addr, sizeof(addr)); >+ result = pi_bind(parent_sd, port); > /* > } else { > result = pi_bind(parent_sd, NULL, 0); >@@ -999,7 +997,7 @@ > bProceed = 0; > } else { > int so_timeout = 16; >- int sizeof_so_timeout = sizeof(so_timeout); >+ size_t sizeof_so_timeout = sizeof(so_timeout); > > pi_setsockopt(client_sd, PI_LEVEL_DEV, PI_DEV_TIMEOUT, > &so_timeout, &sizeof_so_timeout); >@@ -1046,17 +1044,16 @@ > unsigned long iRsrcType; /* Resource type */ > int iRsrcID; /* Resource ID */ > int iRsrcSize; /* Actual resource size */ >- jbyte * pRsrcData; /* Buffer for resource data */ >- int iResult; /* Result of library call */ >+ pi_buffer_t *pRsrcData; /* Buffer for resource data */ > jobject pRecordObject = NULL; > > /* Get "enough" memory for incoming resource data */ >- if ((pRsrcData = (jbyte *)malloc(MAX_RESOURCE_SIZE * sizeof(jbyte))) != NULL) { >+ if ((pRsrcData = pi_buffer_new(MAX_RESOURCE_SIZE * sizeof(jbyte))) != NULL) { > > /* Invoke C library function */ >- iResult = dlp_ReadResourceByIndex(iSockHandle, iDBHandle, iRsrcIndex, >- pRsrcData, &iRsrcType, &iRsrcID, &iRsrcSize); >- if (iResult >= 0) { >+ iRsrcSize = dlp_ReadResourceByIndex(iSockHandle, iDBHandle, iRsrcIndex, >+ pRsrcData, &iRsrcType, &iRsrcID); >+ if (iRsrcSize >= 0) { > jclass pRecordClass; > jmethodID pRecordConstructor; > >@@ -1067,14 +1064,14 @@ > > /* Fill a Java array with resource data && invoke constructor */ > jbyteArray pJavaArray = env->NewByteArray(iRsrcSize); >- env->SetByteArrayRegion(pJavaArray, 0, iRsrcSize, pRsrcData); >+ env->SetByteArrayRegion(pJavaArray, 0, iRsrcSize, (jbyte *)pRsrcData->data); > pRecordObject = env->NewObject(pRecordClass, pRecordConstructor, > pJavaArray, (jlong)iRsrcID, (jint)iRsrcSize, (jint)0, (jint)iRsrcType); > } > } else { >- postPilotLinkException(env, "Unable to read resource by index", iResult, errno); >+ postPilotLinkException(env, "Unable to read resource by index", iRsrcSize, errno); > } >- free(pRsrcData); >+ pi_buffer_free(pRsrcData); > } else { > postJavaException(env, > "org/gnu/pilotlink/PilotLinkException", >@@ -1175,10 +1172,11 @@ > { > int iResult = 0; > struct DBInfo rInfoDB; >+ pi_buffer_t pi_bufInfoDB = {(unsigned char *) &rInfoDB, sizeof(struct DBInfo), 0}; > jobject pDBInfoObject = NULL; > > /* Execute low-level library call... */ >- iResult = dlp_ReadDBList(iSockHandle, cardno, flags, start, &rInfoDB); >+ iResult = dlp_ReadDBList(iSockHandle, cardno, flags, start, &pi_bufInfoDB); > if (iResult >= 0) { > jclass pDBInfoClass = NULL; > jmethodID pDBInfoMethod = NULL;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 127233
:
82881
|
82882
| 82883 |
82884
|
82885
|
82886
|
82887