@@ -193,23 +193,25 @@ long double DateTimeArrayImpl::getDateTime ( const int idx )
193193
194194 if ( dbdatetime_ )
195195 {
196- OCIInterval *interval = NULL ;
196+ void *interval = NULL ;
197197
198- rc = OCIDescriptorAlloc ( (dvoid *) envh_, (dvoid **) &interval,
198+ rc = OCIDescriptorAlloc ( (dvoid *) envh_, &interval,
199199 OCI_DTYPE_INTERVAL_DS, 0 , (dvoid **)0 );
200+
200201 if (rc)
201202 {
202203 throw ExceptionImpl ( DpiErrInternal );
203204 }
204205
205206 /* Get diff of date/timestamp */
206207 rc = OCIDateTimeSubtract ( envh_, errh_, dbdatetime_[idx], baseDate_,
207- interval);
208+ ( OCIInterval * ) interval );
208209 ociCall ( rc, errh_ ) ;
209210
210211 // Get the Days, hours, minutes, seconds and fractional seconds
211212 ociCall ( OCIIntervalGetDaySecond ( envh_, errh_, &dy, &hr, &mm,
212- &ss, &fsec, interval ), errh_ );
213+ &ss, &fsec,
214+ ( OCIInterval * ) interval ), errh_ );
213215
214216 if ( interval )
215217 {
@@ -251,7 +253,7 @@ void DateTimeArrayImpl::setDateTime ( const int idx, long double ms)
251253{
252254 if ( dbdatetime_ )
253255 {
254- OCIInterval *interval = NULL ;
256+ void *interval = NULL ;
255257 sword rc = OCI_SUCCESS ;
256258 sb4 dy = 0 ;
257259 sb4 hr = 0 ;
@@ -270,19 +272,22 @@ void DateTimeArrayImpl::setDateTime ( const int idx, long double ms)
270272 ms = ms - (ss * DPI_MS_SECONDS );
271273 fs = ( sb4 )( ms * DPI_FRAC_SEC_MS ); // Convert the ms into frac sec
272274
273- rc = OCIDescriptorAlloc ( (dvoid *) envh_, (dvoid **) &interval,
275+ rc = OCIDescriptorAlloc ( (dvoid *) envh_, &interval,
274276 OCI_DTYPE_INTERVAL_DS, 0 , (dvoid **)0 );
277+
275278 if (rc)
276279 {
277280 throw ExceptionImpl ( DpiErrInternal );
278281 }
279282
280283 // Convert the given timestamp in ms into interval
281284 ociCall ( OCIIntervalSetDaySecond ( envh_, errh_, dy, hr, mm,
282- ss, fs, interval), errh_ );
285+ ss, fs, ( OCIInterval * ) interval),
286+ errh_ );
283287
284288 // Add the interval to the basedate.
285- ociCall ( OCIDateTimeIntervalAdd ( envh_, errh_, baseDate_, interval,
289+ ociCall ( OCIDateTimeIntervalAdd ( envh_, errh_, baseDate_,
290+ ( OCIInterval * ) interval,
286291 dbdatetime_[idx] ), errh_ ) ;
287292
288293 if ( interval )
@@ -314,14 +319,16 @@ void DateTimeArrayImpl::setDateTime ( const int idx, long double ms)
314319void DateTimeArrayImpl::initBaseDate ( OCIEnv *envh )
315320{
316321 sword rc = OCI_SUCCESS ;
317- OCIError *errh = (OCIError *)0 ;
322+ void *errh = (OCIError *)0 ;
323+ void *baseDate = NULL ;
318324
319325 // If baseDate is not allocated, allocate and init
320326 if ( !baseDate_ )
321327 {
322- rc = OCIDescriptorAlloc ( (dvoid *)envh, (dvoid **)&baseDate_ ,
328+ rc = OCIDescriptorAlloc ( (dvoid *)envh, &baseDate ,
323329 OCI_DTYPE_TIMESTAMP_LTZ, 0 ,
324330 (dvoid **)0 );
331+ baseDate_ = (OCIDateTime *) baseDate;
325332
326333 if ( !rc ) // OCI_SUCCESS case
327334 {
@@ -331,16 +338,17 @@ void DateTimeArrayImpl::initBaseDate ( OCIEnv *envh )
331338 * OCI Env creation(one time). At this point of time, errh is not yet
332339 * created by OCI Env, create a local one, use and destroy
333340 */
334- ociCallEnv (OCIHandleAlloc ((void *)envh, (dvoid **) &errh,
341+ ociCallEnv (OCIHandleAlloc ((void *)envh, &errh,
335342 OCI_HTYPE_ERROR, 0 , (dvoid **)0 ), envh);
343+
336344 // Base date is 1970-1-1 00:00:00
337- ociCall ( OCIDateTimeConstruct (envh, errh, baseDate_,
345+ ociCall ( OCIDateTimeConstruct (envh, ( OCIError * ) errh, baseDate_,
338346 DPI_BASE_YEAR, DPI_BASE_MONTH,
339347 DPI_BASE_DATE, DPI_BASE_HOUR,
340348 DPI_BASE_MIN, DPI_BASE_SEC, DPI_BASE_FS,
341349 (OraText * )DPI_UTC_TZ,
342350 strlen ( DPI_UTC_TZ ) ),
343- errh);
351+ ( OCIError * ) errh);
344352
345353 // Free the allocated error handle
346354 if (errh)
0 commit comments