@@ -193,23 +193,25 @@ long double DateTimeArrayImpl::getDateTime ( const int idx )
193
193
194
194
if ( dbdatetime_ )
195
195
{
196
- OCIInterval *interval = NULL ;
196
+ void *interval = NULL ;
197
197
198
- rc = OCIDescriptorAlloc ( (dvoid *) envh_, (dvoid **) &interval,
198
+ rc = OCIDescriptorAlloc ( (dvoid *) envh_, &interval,
199
199
OCI_DTYPE_INTERVAL_DS, 0 , (dvoid **)0 );
200
+
200
201
if (rc)
201
202
{
202
203
throw ExceptionImpl ( DpiErrInternal );
203
204
}
204
205
205
206
/* Get diff of date/timestamp */
206
207
rc = OCIDateTimeSubtract ( envh_, errh_, dbdatetime_[idx], baseDate_,
207
- interval);
208
+ ( OCIInterval * ) interval );
208
209
ociCall ( rc, errh_ ) ;
209
210
210
211
// Get the Days, hours, minutes, seconds and fractional seconds
211
212
ociCall ( OCIIntervalGetDaySecond ( envh_, errh_, &dy, &hr, &mm,
212
- &ss, &fsec, interval ), errh_ );
213
+ &ss, &fsec,
214
+ ( OCIInterval * ) interval ), errh_ );
213
215
214
216
if ( interval )
215
217
{
@@ -251,7 +253,7 @@ void DateTimeArrayImpl::setDateTime ( const int idx, long double ms)
251
253
{
252
254
if ( dbdatetime_ )
253
255
{
254
- OCIInterval *interval = NULL ;
256
+ void *interval = NULL ;
255
257
sword rc = OCI_SUCCESS ;
256
258
sb4 dy = 0 ;
257
259
sb4 hr = 0 ;
@@ -270,19 +272,22 @@ void DateTimeArrayImpl::setDateTime ( const int idx, long double ms)
270
272
ms = ms - (ss * DPI_MS_SECONDS );
271
273
fs = ( sb4 )( ms * DPI_FRAC_SEC_MS ); // Convert the ms into frac sec
272
274
273
- rc = OCIDescriptorAlloc ( (dvoid *) envh_, (dvoid **) &interval,
275
+ rc = OCIDescriptorAlloc ( (dvoid *) envh_, &interval,
274
276
OCI_DTYPE_INTERVAL_DS, 0 , (dvoid **)0 );
277
+
275
278
if (rc)
276
279
{
277
280
throw ExceptionImpl ( DpiErrInternal );
278
281
}
279
282
280
283
// Convert the given timestamp in ms into interval
281
284
ociCall ( OCIIntervalSetDaySecond ( envh_, errh_, dy, hr, mm,
282
- ss, fs, interval), errh_ );
285
+ ss, fs, ( OCIInterval * ) interval),
286
+ errh_ );
283
287
284
288
// Add the interval to the basedate.
285
- ociCall ( OCIDateTimeIntervalAdd ( envh_, errh_, baseDate_, interval,
289
+ ociCall ( OCIDateTimeIntervalAdd ( envh_, errh_, baseDate_,
290
+ ( OCIInterval * ) interval,
286
291
dbdatetime_[idx] ), errh_ ) ;
287
292
288
293
if ( interval )
@@ -314,14 +319,16 @@ void DateTimeArrayImpl::setDateTime ( const int idx, long double ms)
314
319
void DateTimeArrayImpl::initBaseDate ( OCIEnv *envh )
315
320
{
316
321
sword rc = OCI_SUCCESS ;
317
- OCIError *errh = (OCIError *)0 ;
322
+ void *errh = (OCIError *)0 ;
323
+ void *baseDate = NULL ;
318
324
319
325
// If baseDate is not allocated, allocate and init
320
326
if ( !baseDate_ )
321
327
{
322
- rc = OCIDescriptorAlloc ( (dvoid *)envh, (dvoid **)&baseDate_ ,
328
+ rc = OCIDescriptorAlloc ( (dvoid *)envh, &baseDate ,
323
329
OCI_DTYPE_TIMESTAMP_LTZ, 0 ,
324
330
(dvoid **)0 );
331
+ baseDate_ = (OCIDateTime *) baseDate;
325
332
326
333
if ( !rc ) // OCI_SUCCESS case
327
334
{
@@ -331,16 +338,17 @@ void DateTimeArrayImpl::initBaseDate ( OCIEnv *envh )
331
338
* OCI Env creation(one time). At this point of time, errh is not yet
332
339
* created by OCI Env, create a local one, use and destroy
333
340
*/
334
- ociCallEnv (OCIHandleAlloc ((void *)envh, (dvoid **) &errh,
341
+ ociCallEnv (OCIHandleAlloc ((void *)envh, &errh,
335
342
OCI_HTYPE_ERROR, 0 , (dvoid **)0 ), envh);
343
+
336
344
// Base date is 1970-1-1 00:00:00
337
- ociCall ( OCIDateTimeConstruct (envh, errh, baseDate_,
345
+ ociCall ( OCIDateTimeConstruct (envh, ( OCIError * ) errh, baseDate_,
338
346
DPI_BASE_YEAR, DPI_BASE_MONTH,
339
347
DPI_BASE_DATE, DPI_BASE_HOUR,
340
348
DPI_BASE_MIN, DPI_BASE_SEC, DPI_BASE_FS,
341
349
(OraText * )DPI_UTC_TZ,
342
350
strlen ( DPI_UTC_TZ ) ),
343
- errh);
351
+ ( OCIError * ) errh);
344
352
345
353
// Free the allocated error handle
346
354
if (errh)
0 commit comments