Project

Profile

Help

Revision 6304fb8b

Added by O'Neil Delpratt 5 months ago

Saxon/C bug fixes and development work

View differences:

latest10/hec/Saxon.C.API/php7_saxon.cpp
51 51
	obj =  (saxonProcessor_object *)((char *)object - XtOffsetOf(saxonProcessor_object, std));
52 52

  
53 53
 SaxonProcessor * saxonProc= obj->saxonProcessor;
54
    if(saxonProc != NULL) {
54
    if(saxonProc != nullptr) {
55 55
	//SaxonProcessor::release();    
56 56
	delete saxonProc;
57 57
    }
......
69 69
 /*  saxonProcessor_object * obj = (saxonProcessor_object *)((char *)pobj - XtOffsetOf(saxonProcessor_object, std));
70 70

  
71 71
    SaxonProcessor * saxonProc= obj->saxonProcessor;
72
    if(saxonProc != NULL) {
72
    if(saxonProc != nullptr) {
73 73
	SaxonProcessor::release();    
74 74
	delete saxonProc;
75 75
    }*/
......
100 100
        WRONG_PARAM_COUNT;
101 101
    }
102 102

  
103
    char * cwdi = NULL;
103
    char * cwdi = nullptr;
104 104
   bool license = false;
105 105
    size_t len1;
106 106
    if (ZEND_NUM_ARGS()==1 && zend_parse_parameters(ZEND_NUM_ARGS(), "b", &license) == FAILURE) {
......
114 114

  
115 115

  
116 116
    zval *object = getThis();
117
    SaxonProcessor * saxonProc = NULL;
117
    SaxonProcessor * saxonProc = nullptr;
118 118
    zend_object * zobj = Z_OBJ_P(object);
119 119

  
120 120
    saxonProcessor_object * obj = (saxonProcessor_object *)((char *)zobj - XtOffsetOf(saxonProcessor_object, std));
......
124 124
    
125 125
	obj->saxonProcessor = saxonProc;
126 126
//std::cerr<<"SaxonProcessorConstructor cp1"<<std::endl;
127
    if(cwdi==NULL) {
127
    if(cwdi==nullptr) {
128 128
//std::cerr<<"SaxonProcessorConstructor cp1-1"<<std::endl;
129 129
#if !(defined (__linux__) || (defined (__APPLE__) && defined(__MACH__)))
130 130
	    TCHAR s[256];
......
146 146
	    char cwd[256];
147 147

  
148 148
	    VCWD_GETCWD(cwd, sizeof(cwd));
149
	    if(cwd == NULL) {
150
	     //php_error(E_WARNING,"cwd is nullXXXXXXXXXXXXXXXXXXXXXXX");
149
	    if(cwd == nullptr) {
150
	     //php_error(E_WARNING,"cwd is nullptrXXXXXXXXXXXXXXXXXXXXXXX");
151 151
	   }else {
152 152
           //  php_error(E_WARNING,cwd);
153 153
 
......
170 170
   saxonProcessor_object * obj = (saxonProcessor_object *)((char *)pobj - XtOffsetOf(saxonProcessor_object, std));
171 171

  
172 172
    SaxonProcessor * saxonProc= obj->saxonProcessor;
173
    if(saxonProc != NULL) {
173
    if(saxonProc != nullptr) {
174 174
	//SaxonProcessor::release();    
175 175
	//delete saxonProc;
176 176
    }
......
185 185
   saxonProcessor_object * obj = (saxonProcessor_object *)((char *)pobj - XtOffsetOf(saxonProcessor_object, std));
186 186

  
187 187
    SaxonProcessor * saxonProc= obj->saxonProcessor;
188
    if(saxonProc != NULL) {
188
    if(saxonProc != nullptr) {
189 189
	SaxonProcessor::release();    
190 190
    }
191 191
}
......
203 203
    zend_object* pobj = Z_OBJ_P(getThis()); 
204 204
    saxonProcessor_object * obj = (saxonProcessor_object *)((char *)pobj - XtOffsetOf(saxonProcessor_object, std));
205 205
    saxonProcessor = obj->saxonProcessor;
206
    if (saxonProcessor != NULL) {
206
    if (saxonProcessor != nullptr) {
207 207
       
208
        if(dirStr != NULL) {
208
        if(dirStr != nullptr) {
209 209
            saxonProcessor->setResourcesDirectory(dirStr);
210 210
        }
211 211
    }
......
222 222
    zend_object* pobj = Z_OBJ_P(getThis()); 
223 223
    saxonProcessor_object * obj = (saxonProcessor_object *)((char *)pobj - XtOffsetOf(saxonProcessor_object, std));
224 224
    saxonProcessor = obj->saxonProcessor;
225
    if (saxonProcessor != NULL) {
225
    if (saxonProcessor != nullptr) {
226 226
       
227 227
         if(saxonProcessor->isSchemaAwareProcessor()){
228 228

  
......
246 246
    zend_object* pobj = Z_OBJ_P(getThis()); 
247 247
    saxonProcessor_object * obj = (saxonProcessor_object *)((char *)pobj - XtOffsetOf(saxonProcessor_object, std));
248 248
    saxonProcessor = obj->saxonProcessor;
249
    if (saxonProcessor != NULL) {
249
    if (saxonProcessor != nullptr) {
250 250
       
251
        if(catalogFile != NULL) {
251
        if(catalogFile != nullptr) {
252 252
            saxonProcessor->setCatalog(catalogFile, trace);
253 253
        }
254 254
    }
......
269 269
    zend_object* pobj = Z_OBJ_P(getThis()); 
270 270
    saxonProcessor_object * obj = (saxonProcessor_object *)((char *)pobj - XtOffsetOf(saxonProcessor_object, std));
271 271
    saxonProcessor = obj->saxonProcessor;
272
    if (saxonProcessor != NULL) {
272
    if (saxonProcessor != nullptr) {
273 273
        
274
        if(cwdStr != NULL) {
274
        if(cwdStr != nullptr) {
275 275
            saxonProcessor->setcwd(cwdStr);
276 276
        }
277 277
    }
......
289 289
    }
290 290
    zend_object* pobj = Z_OBJ_P(getThis()); 
291 291
    saxonProcessor_object * obj = (saxonProcessor_object *)((char *)pobj - XtOffsetOf(saxonProcessor_object, std));
292
    assert (obj != NULL);
292
    assert (obj != nullptr);
293 293
    saxonProcessor = obj->saxonProcessor;
294
    if (saxonProcessor != NULL) {
294
    if (saxonProcessor != nullptr) {
295 295
        XdmNode* node = saxonProcessor->parseXmlFromString(source);
296
        if(node != NULL) {
296
        if(node != nullptr) {
297 297
            if (object_init_ex(return_value, xdmNode_ce) != SUCCESS) {
298 298
                RETURN_NULL();
299 299
            } else {
300 300
                zend_object* vobj = Z_OBJ_P(return_value);
301 301
 		xdmNode_object * xdmNObj = (xdmNode_object *)((char *)vobj - XtOffsetOf(xdmNode_object, std));
302
                assert (xdmNObj != NULL);
302
                assert (xdmNObj != nullptr);
303 303
                xdmNObj->xdmNode = node;
304 304
            }
305 305
        } else {
......
323 323
    }
324 324
    zend_object* pobj = Z_OBJ_P(getThis()); 
325 325
    saxonProcessor_object * obj = (saxonProcessor_object *)((char *)pobj - XtOffsetOf(saxonProcessor_object, std));
326
    assert (obj != NULL);
326
    assert (obj != nullptr);
327 327
    saxonProcessor = obj->saxonProcessor;
328
    if (saxonProcessor != NULL) {
328
    if (saxonProcessor != nullptr) {
329 329
        XdmNode* node = saxonProcessor->parseXmlFromFile(source);//TODO this needs to be XdmNode object
330
        if(node != NULL) {
330
        if(node != nullptr) {
331 331
      
332 332
            if (object_init_ex(return_value, xdmNode_ce) != SUCCESS) {
333 333
                RETURN_NULL();
......
336 336
            zend_object* vvobj = Z_OBJ_P(return_value);
337 337
            xdmNode_object * vobj = (xdmNode_object *)((char *)vvobj - XtOffsetOf(xdmNode_object, std));
338 338
                
339
                assert (vobj != NULL);
339
                assert (vobj != nullptr);
340 340
                vobj->xdmNode = node;
341 341
            }
342 342
        } else {
......
352 352

  
353 353
PHP_METHOD(SaxonProcessor, createAtomicValue)
354 354
{
355
    XdmAtomicValue * xdmValue = NULL;
355
    XdmAtomicValue * xdmValue = nullptr;
356 356
    SaxonProcessor * proc;
357 357
    char * source;
358 358
    int len1;
......
367 367
    }
368 368
    zend_object* pobj = Z_OBJ_P(getThis()); 
369 369
    saxonProcessor_object * obj = (saxonProcessor_object *)((char *)pobj - XtOffsetOf(saxonProcessor_object, std));
370
    assert (obj != NULL);
370
    assert (obj != nullptr);
371 371
    proc = obj->saxonProcessor;
372
    assert (proc != NULL);
373
    if (proc != NULL) {
372
    assert (proc != nullptr);
373
    if (proc != nullptr) {
374 374
	switch (Z_TYPE_P(zvalue)) {
375 375
            case IS_FALSE:
376 376
	    xdmValue = proc->makeBooleanValue(false);
......
402 402
                // TODO: implement this
403 403
                //break;
404 404
            default:
405
                obj = NULL;
405
                obj = nullptr;
406 406
                zend_throw_exception(zend_exception_get_default(TSRMLS_C), "unknown type specified in XdmValue", 0 TSRMLS_CC); 
407 407
                RETURN_NULL();
408 408
        }
409 409
//std::cerr<<"createAtomicValue cp0"<<std::endl;
410
        if(xdmValue == NULL) {
410
        if(xdmValue == nullptr) {
411 411
            RETURN_NULL();
412 412
        }
413 413
        if (object_init_ex(return_value, xdmAtomicValue_ce) != SUCCESS) {
......
416 416
            //struct xdmAtomicValue_object* vobj = (struct xdmAtomicValue_object *)Z_OBJ_P(return_value);
417 417
 	    zend_object* vvobj = Z_OBJ_P(return_value);
418 418
	   xdmAtomicValue_object * vobj = (xdmAtomicValue_object *)((char *)vvobj - XtOffsetOf(xdmAtomicValue_object, std));
419
            assert (vobj != NULL);
419
            assert (vobj != nullptr);
420 420
            vobj->xdmAtomicValue = xdmValue;
421 421
        }
422 422
    } else {
......
433 433
        WRONG_PARAM_COUNT;
434 434
    }
435 435
    SaxonProcessor * proc;
436
    XPathProcessor * xpathProcessor = NULL;
436
    XPathProcessor * xpathProcessor = nullptr;
437 437

  
438 438
    zend_object* pobj = Z_OBJ_P(getThis()); 
439 439
    saxonProcessor_object * obj = (saxonProcessor_object *)((char *)pobj - XtOffsetOf(saxonProcessor_object, std));
440 440

  
441
    assert (obj != NULL);
441
    assert (obj != nullptr);
442 442
    proc = obj->saxonProcessor;
443
    assert (proc != NULL);
444
    if (proc != NULL) {
443
    assert (proc != nullptr);
444
    if (proc != nullptr) {
445 445
if (object_init_ex(return_value, xpathProcessor_ce) != SUCCESS) {
446 446
            RETURN_NULL();
447 447
        } else {
448 448
	  // struct xpathProcessor_object* vobji = (struct xpathProcessor_object *)Z_OBJ_P(return_value TSRMLS_CC);
449 449
	   zend_object* vvobj = Z_OBJ_P(return_value);
450 450
	   xpathProcessor_object * vobj = (xpathProcessor_object *)((char *)vvobj - XtOffsetOf(xpathProcessor_object, std));
451
            assert (vobj != NULL);
451
            assert (vobj != nullptr);
452 452
	    xpathProcessor = proc->newXPathProcessor();
453 453
            vobj->xpathProcessor = xpathProcessor;
454 454
	}
......
466 466
        WRONG_PARAM_COUNT;
467 467
    }
468 468
    SaxonProcessor * proc;
469
    XsltProcessor * xsltProcessor = NULL;
469
    XsltProcessor * xsltProcessor = nullptr;
470 470

  
471 471
      zend_object* pobj = Z_OBJ_P(getThis()); 
472 472
   saxonProcessor_object * obj = (saxonProcessor_object *)((char *)pobj - XtOffsetOf(saxonProcessor_object, std));
473 473

  
474 474
   // saxonProcessor_object *obj = (saxonProcessor_object *)Z_OBJ_P(getThis());
475
    assert (obj != NULL);
475
    assert (obj != nullptr);
476 476
    proc = obj->saxonProcessor;
477 477

  
478
    assert (proc != NULL);
479
    if (proc != NULL) {
478
    assert (proc != nullptr);
479
    if (proc != nullptr) {
480 480
    if (object_init_ex(return_value, xsltProcessor_ce) != SUCCESS) {
481 481
            RETURN_NULL();
482 482
        } else {
483 483
	xsltProcessor = proc->newXsltProcessor();
484 484
	   zend_object* vobj = Z_OBJ_P(return_value);
485 485
	   xsltProcessor_object * xproc_object = (xsltProcessor_object *)((char *)vobj - XtOffsetOf(xsltProcessor_object, std));
486
            assert (vobj != NULL);
486
            assert (vobj != nullptr);
487 487
	    
488 488
            xproc_object->xsltProcessor = xsltProcessor;
489 489

  
......
503 503
        WRONG_PARAM_COUNT;
504 504
    }
505 505
    SaxonProcessor * proc;
506
    Xslt30Processor * xslt30Processor = NULL;
506
    Xslt30Processor * xslt30Processor = nullptr;
507 507

  
508 508
      zend_object* pobj = Z_OBJ_P(getThis());
509 509
   saxonProcessor_object * obj = (saxonProcessor_object *)((char *)pobj - XtOffsetOf(saxonProcessor_object, std));
510 510

  
511 511
   // saxonProcessor_object *obj = (saxonProcessor_object *)Z_OBJ_P(getThis());
512
    assert (obj != NULL);
512
    assert (obj != nullptr);
513 513
    proc = obj->saxonProcessor;
514 514

  
515
    assert (proc != NULL);
516
    if (proc != NULL) {
515
    assert (proc != nullptr);
516
    if (proc != nullptr) {
517 517
    if (object_init_ex(return_value, xslt30Processor_ce) != SUCCESS) {
518 518
            RETURN_NULL();
519 519
        } else {
520 520
	xslt30Processor = proc->newXslt30Processor();	
521 521
	   zend_object* vobj = Z_OBJ_P(return_value);
522 522
	   xslt30Processor_object * xproc_object = (xslt30Processor_object *)((char *)vobj - XtOffsetOf(xslt30Processor_object, std));
523
            assert (vobj != NULL);
523
            assert (vobj != nullptr);
524 524

  
525 525
            xproc_object->xslt30Processor = xslt30Processor;
526 526

  
......
538 538
        WRONG_PARAM_COUNT;
539 539
    }
540 540
    SaxonProcessor * proc;
541
    XQueryProcessor * xqueryProcessor = NULL;
541
    XQueryProcessor * xqueryProcessor = nullptr;
542 542
     zend_object* pobj = Z_OBJ_P(getThis()); 
543 543
    saxonProcessor_object * obj = (saxonProcessor_object *)((char *)pobj - XtOffsetOf(saxonProcessor_object, std));
544
    assert (obj != NULL);
544
    assert (obj != nullptr);
545 545
    proc = obj->saxonProcessor;
546
    assert (proc != NULL);
547
    if (proc != NULL) {
546
    assert (proc != nullptr);
547
    if (proc != nullptr) {
548 548
	if (object_init_ex(return_value, xqueryProcessor_ce) != SUCCESS) {
549 549
            RETURN_NULL();
550 550
        } else {
551 551
	  xqueryProcessor = proc->newXQueryProcessor();
552 552
	  zend_object* vvobj = Z_OBJ_P(return_value);
553 553
	   xqueryProcessor_object * vobj = (xqueryProcessor_object *)((char *)vvobj - XtOffsetOf(xqueryProcessor_object, std));
554
            assert (vvobj != NULL);
554
            assert (vvobj != nullptr);
555 555
	    
556 556
            vobj->xqueryProcessor = xqueryProcessor;
557 557
     }
......
568 568
        WRONG_PARAM_COUNT;
569 569
    }
570 570
    SaxonProcessor * proc;
571
    SchemaValidator * schemaValidator = NULL;
571
    SchemaValidator * schemaValidator = nullptr;
572 572
   
573 573
    zend_object* pobj = Z_OBJ_P(getThis()); 
574 574
    saxonProcessor_object * obj = (saxonProcessor_object *)((char *)pobj - XtOffsetOf(saxonProcessor_object, std));
575
    assert (obj != NULL);
575
    assert (obj != nullptr);
576 576
    proc = obj->saxonProcessor;
577
    assert (proc != NULL);
578
    if (proc != NULL) {
577
    assert (proc != nullptr);
578
    if (proc != nullptr) {
579 579
	if (object_init_ex(return_value, schemaValidator_ce) != SUCCESS) {
580 580
            RETURN_NULL();
581 581
        } else {
582 582
	   //struct schemaValidator_object* vobj = (struct schemaValidator_object *)Z_OBJ_P(return_value TSRMLS_CC);
583 583
	   zend_object* vvobj = Z_OBJ_P(return_value);
584 584
	   schemaValidator_object * vobj = (schemaValidator_object *)((char *)vvobj - XtOffsetOf(schemaValidator_object, std));
585
            assert (vobj != NULL);
585
            assert (vobj != nullptr);
586 586
	    schemaValidator = proc->newSchemaValidator();
587
	    if(schemaValidator == NULL){
587
	    if(schemaValidator == nullptr){
588 588
		RETURN_NULL();
589 589
	    }
590 590
            vobj->schemaValidator = schemaValidator;
......
607 607
    zend_object* pobj = Z_OBJ_P(getThis()); 
608 608
   saxonProcessor_object * obj = (saxonProcessor_object *)((char *)pobj - XtOffsetOf(saxonProcessor_object, std));
609 609
    saxonProcessor = obj->saxonProcessor;
610
    if (saxonProcessor != NULL) {
610
    if (saxonProcessor != nullptr) {
611 611
	const char * verStr = saxonProcessor->version();
612 612
        //char *str = estrdup(saxonProcessor->version());
613 613
        _RETURN_STRING(verStr);
......
635 635
    saxonProcessor_object * obj = (saxonProcessor_object *)((char *)pobj - XtOffsetOf(saxonProcessor_object, std));
636 636

  
637 637
    saxonProcessor = obj->saxonProcessor;
638
    if (saxonProcessor != NULL && name != NULL && value != NULL) {
638
    if (saxonProcessor != nullptr && name != nullptr && value != nullptr) {
639 639
        saxonProcessor->setConfigurationProperty(name, value);
640 640
    }
641 641
    
......
659 659
    saxonProcessor_object * obj = (saxonProcessor_object *)((char *)pobj - XtOffsetOf(saxonProcessor_object, std));
660 660

  
661 661
    saxonProcessor = obj->saxonProcessor;
662
    if (saxonProcessor != NULL && libName != NULL) {
662
    if (saxonProcessor != nullptr && libName != nullptr) {
663 663
        saxonProcessor->setConfigurationProperty("extc", libName);
664 664
    }
665 665
saxonProcessor->registerNativeMethods(SaxonProcessor::sxn_environ->env, "com/saxonica/functions/extfn/cpp/PHPFunctionSet$PHPFunction",
......
707 707

  
708 708

  
709 709
    XsltProcessor * xsltProcessor= obj->xsltProcessor;
710
    if(xsltProcessor != NULL){
710
    if(xsltProcessor != nullptr){
711 711
    	delete xsltProcessor;
712 712
     }
713 713
 
......
730 730
    xsltProcessor_object *obj = (xsltProcessor_object *)((char *)pobj - XtOffsetOf(xsltProcessor_object, std));
731 731
    xsltProcessor = obj->xsltProcessor;
732 732
 
733
    if (xsltProcessor != NULL) {
733
    if (xsltProcessor != nullptr) {
734 734

  
735 735
        xsltProcessor->transformFileToFile(infilename, styleFileName, outfileName);
736 736
        if(xsltProcessor->exceptionOccurred()) {
......
754 754
    xsltProcessor_object *obj = (xsltProcessor_object *)((char *)pobj - XtOffsetOf(xsltProcessor_object, std));
755 755
    xsltProcessor = obj->xsltProcessor;
756 756
    
757
    if (xsltProcessor != NULL) {
757
    if (xsltProcessor != nullptr) {
758 758

  
759 759
        XdmValue * node = xsltProcessor->transformFileToValue(infilename, styleFileName);
760
        if(node != NULL) {
760
        if(node != nullptr) {
761 761
            if (object_init_ex(return_value, xdmValue_ce) != SUCCESS) {
762 762
                RETURN_NULL();
763 763
            } else {
764 764
		zend_object *ooth =  Z_OBJ_P(return_value);
765 765
                //struct xdmValue_object* vobj = (struct xdmValue_object *)Z_OBJ_P(return_value TSRMLS_CC);
766 766
		xdmValue_object* vobj  = (xdmValue_object *)((char *)ooth - XtOffsetOf(xdmValue_object, std));
767
                assert (vobj != NULL);
767
                assert (vobj != nullptr);
768 768
                vobj->xdmValue = node;
769 769
            }
770 770
        } else {
......
793 793
    xsltProcessor_object *obj = (xsltProcessor_object *)((char *)pobj - XtOffsetOf(xsltProcessor_object, std));
794 794
    xsltProcessor = obj->xsltProcessor;
795 795

  
796
    if (xsltProcessor != NULL) {
796
    if (xsltProcessor != nullptr) {
797 797

  
798 798
        const char * result = xsltProcessor->transformFileToString(infilename, styleFileName);
799
	if(result != NULL) {
799
	if(result != nullptr) {
800 800
            //char *str = estrdup(result);
801 801
            _RETURN_STRING(result);
802 802
        } else if(xsltProcessor->exceptionOccurred()){
803 803
            //TODO: xsltProcessor->checkException();
804 804
            const char * errStr = xsltProcessor->getErrorMessage(0);
805
            if(errStr != NULL) {
805
            if(errStr != nullptr) {
806 806
                const char * errorCode = xsltProcessor->getErrorCode(0);
807
                if(errorCode!=NULL) {
807
                if(errorCode!=nullptr) {
808 808
                    // TODO: throw exception
809 809
                }
810 810
            }
......
827 827
  (JNIEnv *env, jobject object, jstring funcName, jobjectArray arguments, jobjectArray argTypes){
828 828
	JNIEnv *senv = SaxonProcessor::sxn_environ->env;
829 829
//	std::cerr<<"phpNative called"<<std::endl;
830
	char *nativeString = (char *)senv->GetStringUTFChars(funcName, NULL);
830
	char *nativeString = (char *)senv->GetStringUTFChars(funcName, nullptr);
831 831
	std::string nativeString2 = std::string(nativeString);
832
	if(nativeString == NULL) {
833
		return NULL;	
832
	if(nativeString == nullptr) {
833
		return nullptr;
834 834
	}
835 835
	int nativeStrLen = strlen(nativeString);
836 836
//std::cerr<<"phpNative called. nativeString="<<nativeString<<", length="<<nativeStrLen<<std::endl;
......
838 838
	zval retval;
839 839
	
840 840
	int argLength = 0;
841
	zvalArr * php_argv= NULL;
842
	if(arguments != NULL) {
841
	zvalArr * php_argv= nullptr;
842
	if(arguments != nullptr) {
843 843
		argLength = (int)senv->GetArrayLength(arguments);
844 844
		php_argv = new zvalArr[argLength];
845 845
	}
......
848 848
		//(*params) = (zval**)malloc(sizeof(zval*) * argLength);
849 849
		params =  new zval[argLength];
850 850
	} else {
851
		params = NULL;
851
		params = nullptr;
852 852
	}
853 853
	std::map<std::string, saxonTypeEnum> typeMap;
854 854
	typeMap["node"] = enumNode;
......
870 870
		jstring argType = (jstring)senv->GetObjectArrayElement(argTypes, i);
871 871
		jobject argObj = senv->GetObjectArrayElement(arguments, i);
872 872

  
873
		const char * str = senv->GetStringUTFChars(argType,NULL);
874
		const char *stri = NULL;
873
		const char * str = senv->GetStringUTFChars(argType,nullptr);
874
		const char *stri = nullptr;
875 875
		double dnumber = 0;
876 876
		long lnumber = 0;
877 877
		bool bvalue = false;
......
881 881
         
882 882
		struct xdmNode_object* vobj;
883 883
		zend_object* zend_vobj;
884
		XdmNode * node = NULL;
884
		XdmNode * node = nullptr;
885 885
		std::map<std::string, saxonTypeEnum>::iterator it = typeMap.find(str);
886 886
		if (it != typeMap.end()){
887 887
			switch (it->second)
......
902 902
					//MAKE_STD_ZVAL(php_argv[i]._val);
903 903
					zend_vobj = Z_OBJ_P(php_argv[i]._val);
904 904
	   				vobj = (xdmNode_object *)((char *)zend_vobj - XtOffsetOf(xdmNode_object, std));
905
            				assert (vobj != NULL);
905
            				assert (vobj != nullptr);
906 906
	    
907 907
                			vobj->xdmNode = node;
908 908
					break;
909 909
				case enumString:
910
					stri = senv->GetStringUTFChars((jstring)argObj, NULL);
910
					stri = senv->GetStringUTFChars((jstring)argObj, nullptr);
911 911
					//ZVAL_STRING(php_argv[i]._val);
912 912
					_ZVAL_STRING(php_argv[i]._val, stri);
913 913
					break;
......
960 960
	//std::cerr<<"phpNative called cp3-1"<<std::endl;
961 961
	//note: no implicit type conversion.
962 962

  
963
	zval *argvv = NULL;//xparams;
964
	zval* callOnObj = NULL;
963
	zval *argvv = nullptr;//xparams;
964
	zval* callOnObj = nullptr;
965 965
	//MAKE_STD_ZVAL(function_name);
966 966
	//nativeString[nativeStrLen] = '\0';
967 967

  
968 968
	ZVAL_STRING(&function_name, nativeString);
969 969
//std::cerr<<"phpNative called cp3-2, argumentLen="<<argLength<<std::endl;
970
	if(call_user_function_ex(CG(function_table), (zval*)callOnObj, &function_name, &retval, argLength, params, 0, NULL) != SUCCESS)
970
	if(call_user_function_ex(CG(function_table), (zval*)callOnObj, &function_name, &retval, argLength, params, 0, nullptr) != SUCCESS)
971 971
	{
972 972
 	   zend_error(E_ERROR, "Function call failed");
973 973
	}
974 974

  
975 975
	if(Z_TYPE(retval) ==0){
976
		zend_error(E_ERROR, "Function returned null");
976
		zend_error(E_ERROR, "Function returned nullptr");
977 977
	}
978 978

  
979
	char * sVal = NULL;
979
	char * sVal = nullptr;
980 980
	int len = 0;
981
	jobject obj = NULL;
981
	jobject obj = nullptr;
982 982
//TODO handle XdmValue wrapped object
983
const char * objName = NULL;
984
xdmNode_object* ooth = NULL;
983
const char * objName = nullptr;
984
xdmNode_object* ooth = nullptr;
985 985
zend_object* zend_vobj2;
986 986
bool bVal;
987 987
	switch (Z_TYPE_P(&retval)) {
......
1020 1020
			zend_vobj2 =  Z_OBJ_P(&retval);
1021 1021
			ooth = (xdmNode_object *)((char *)zend_vobj2 - XtOffsetOf(xdmNode_object, std));
1022 1022

  
1023
        		if(ooth != NULL) {
1023
        		if(ooth != nullptr) {
1024 1024
            			obj = ooth->xdmNode->getUnderlyingValue();
1025 1025
        		}
1026 1026
      		}
1027 1027
		break;
1028 1028
            default:
1029
                obj = NULL;
1029
                obj = nullptr;
1030 1030
                zend_throw_exception(zend_exception_get_default(TSRMLS_C), "Unknown type specified in extension function", 0 TSRMLS_CC);
1031 1031
        }
1032 1032

  
......
1056 1056
    zend_object* pobj = Z_OBJ_P(getThis()); 
1057 1057
    xsltProcessor_object *obj = (xsltProcessor_object *)((char *)pobj - XtOffsetOf(xsltProcessor_object, std));
1058 1058
    xsltProcessor = obj->xsltProcessor;
1059
    if (xsltProcessor != NULL) {
1059
    if (xsltProcessor != nullptr) {
1060 1060

  
1061 1061
        const char * result = xsltProcessor->transformToString();
1062
        if(result != NULL) {
1062
        if(result != nullptr) {
1063 1063
            _RETURN_STRING(result);
1064 1064
        } else if(xsltProcessor->exceptionOccurred()){
1065 1065
            xsltProcessor->checkException();
1066 1066
            const char * errStr = xsltProcessor->getErrorMessage(0);
1067
            if(errStr != NULL) {
1067
            if(errStr != nullptr) {
1068 1068
                const char * errorCode = xsltProcessor->getErrorCode(0);
1069
                if(errorCode!=NULL) {
1069
                if(errorCode!=nullptr) {
1070 1070
                    // TODO: throw exception
1071 1071
                }
1072 1072
            }
......
1087 1087
    xsltProcessor_object *obj = (xsltProcessor_object *)((char *)pobj - XtOffsetOf(xsltProcessor_object, std));
1088 1088
    xsltProcessor = obj->xsltProcessor;
1089 1089

  
1090
    if (xsltProcessor != NULL) {
1090
    if (xsltProcessor != nullptr) {
1091 1091

  
1092 1092
	XdmValue * node = xsltProcessor->transformToValue();
1093
        if(node != NULL) {
1093
        if(node != nullptr) {
1094 1094
            if (object_init_ex(return_value, xdmValue_ce) != SUCCESS) {
1095 1095
                RETURN_NULL();
1096 1096
            } else {
1097 1097
                //struct xdmValue_object* vobj = (struct xdmValue_object *)Z_OBJ_P(return_value);
1098 1098
		zend_object *vvobj =  Z_OBJ_P(return_value);
1099 1099
		xdmValue_object* vobj  = (xdmValue_object *)((char *)vvobj - XtOffsetOf(xdmValue_object, std));
1100
                assert (vobj != NULL);
1100
                assert (vobj != nullptr);
1101 1101
                vobj->xdmValue = node;
1102 1102
            }
1103 1103
        } else if(xsltProcessor->exceptionOccurred()){
......
1121 1121
    xsltProcessor_object *obj = (xsltProcessor_object *)((char *)pobj - XtOffsetOf(xsltProcessor_object, std));
1122 1122
    xsltProcessor = obj->xsltProcessor;
1123 1123

  
1124
    if (xsltProcessor != NULL) {
1124
    if (xsltProcessor != nullptr) {
1125 1125

  
1126 1126
	xsltProcessor->transformToFile();
1127 1127
        if(xsltProcessor->exceptionOccurred()) {
......
1144 1144
    zend_object* pobj = Z_OBJ_P(getThis()); 
1145 1145
    xsltProcessor_object *obj = (xsltProcessor_object *)((char *)pobj - XtOffsetOf(xsltProcessor_object, std));
1146 1146
    xsltProcessor = obj->xsltProcessor;
1147
    if (xsltProcessor != NULL) {
1147
    if (xsltProcessor != nullptr) {
1148 1148
        xsltProcessor->compileFromFile(name);
1149 1149
    }
1150 1150
}
......
1160 1160
    zend_object* pobj = Z_OBJ_P(getThis()); 
1161 1161
    xsltProcessor_object *obj = (xsltProcessor_object *)((char *)pobj - XtOffsetOf(xsltProcessor_object, std));
1162 1162
    xsltProcessor = obj->xsltProcessor;
1163
    if (xsltProcessor != NULL) {
1163
    if (xsltProcessor != nullptr) {
1164 1164
        xsltProcessor->compileFromString(stylesheetStr);
1165 1165
    }
1166 1166
}
......
1177 1177
    zend_object* pobj = Z_OBJ_P(getThis()); 
1178 1178
    xsltProcessor_object *obj = (xsltProcessor_object *)((char *)pobj - XtOffsetOf(xsltProcessor_object, std));
1179 1179
    xsltProcessor = obj->xsltProcessor;
1180
    if (xsltProcessor != NULL) {
1180
    if (xsltProcessor != nullptr) {
1181 1181
        xsltProcessor->compileFromStringAndSave(stylesheetStr, filename);
1182 1182
    }
1183 1183
}
......
1194 1194
    zend_object* pobj = Z_OBJ_P(getThis()); 
1195 1195
    xsltProcessor_object *obj = (xsltProcessor_object *)((char *)pobj - XtOffsetOf(xsltProcessor_object, std));
1196 1196
    xsltProcessor = obj->xsltProcessor;
1197
    if (xsltProcessor != NULL) {
1197
    if (xsltProcessor != nullptr) {
1198 1198
        xsltProcessor->compileFromStringAndSave(stylesheetFilename, filename);
1199 1199
    }
1200 1200
}
......
1212 1212
    zend_object* pobj = Z_OBJ_P(getThis()); 
1213 1213
    xsltProcessor_object *obj = (xsltProcessor_object *)((char *)pobj - XtOffsetOf(xsltProcessor_object, std));
1214 1214
    xsltProcessor = obj->xsltProcessor;
1215
    if (xsltProcessor != NULL) {
1215
    if (xsltProcessor != nullptr) {
1216 1216
	zend_object* vvobj = Z_OBJ_P(oth);
1217 1217
	xdmValue_object* ooth = (xdmValue_object *)((char *)vvobj - XtOffsetOf(xdmValue_object, std));
1218
        if(ooth != NULL) {
1218
        if(ooth != nullptr) {
1219 1219
            XdmValue * value = ooth->xdmValue;
1220
            if(value != NULL && value->size() == 1 && (value->getHead())->getType() == 3) {
1220
            if(value != nullptr && value->size() == 1 && (value->getHead())->getType() == 3) {
1221 1221
        	xsltProcessor->compileFromXdmNode((XdmNode*)(value->getHead()));
1222 1222
	    }
1223 1223
	}
......
1230 1230
PHP_METHOD(XsltProcessor, setSourceFromXdmValue)
1231 1231
{
1232 1232
    XsltProcessor *xsltProcessor;
1233
    zval* oth = NULL;
1233
    zval* oth = nullptr;
1234 1234

  
1235 1235
    if (zend_parse_parameters(ZEND_NUM_ARGS() , "z", &oth) == FAILURE) {
1236 1236
        RETURN_NULL();
......
1239 1239
    zend_object* pobj = Z_OBJ_P(getThis()); 
1240 1240
    xsltProcessor_object *obj = (xsltProcessor_object *)((char *)pobj - XtOffsetOf(xsltProcessor_object, std));
1241 1241
    xsltProcessor = obj->xsltProcessor;
1242
    if (xsltProcessor != NULL) {
1242
    if (xsltProcessor != nullptr) {
1243 1243

  
1244 1244
    if(!oth) {
1245 1245
	php_error(E_WARNING, "Error setting source value");
......
1257 1257
	zend_object * nobj = Z_OBJ_P(oth);
1258 1258

  
1259 1259
	xdmNode_object* ooth = (xdmNode_object *)((char *)nobj - XtOffsetOf(xdmNode_object, std));//(xdmNode_object*)Z_OBJ_P(oth);
1260
        if(ooth != NULL) {
1260
        if(ooth != nullptr) {
1261 1261
            XdmNode * value = ooth->xdmNode;
1262
            if(value != NULL) {	
1262
            if(value != nullptr) {
1263 1263
		
1264 1264
	        xsltProcessor->setSourceFromXdmNode(value);
1265 1265

  
......
1268 1268
      } /*else if(strcmp(objName, "Saxon\\XdmValue")==0) {
1269 1269
	zend_object* vvobj = Z_OBJ_P(oth);
1270 1270
	xdmValue_object* ooth = (xdmValue_object *)((char *)vvobj - XtOffsetOf(xdmValue_object, std));
1271
        if(ooth != NULL) {
1271
        if(ooth != nullptr) {
1272 1272
            XdmValue * value = ooth->xdmValue;
1273
            if(value != NULL && value) {
1273
            if(value != nullptr && value) {
1274 1274
	        xsltProcessor->setSourceFromXdmNode((XdmNode*)value);
1275 1275
            }
1276 1276
        }
......
1295 1295
    zend_object* pobj = Z_OBJ_P(getThis());
1296 1296
    xsltProcessor_object *obj = (xsltProcessor_object *)((char *)pobj - XtOffsetOf(xsltProcessor_object, std));
1297 1297
    xsltProcessor = obj->xsltProcessor;
1298
    if (xsltProcessor != NULL) {
1298
    if (xsltProcessor != nullptr) {
1299 1299
	 xsltProcessor->setJustInTimeCompilation(jit);
1300 1300
    }
1301 1301
}
......
1313 1313
    zend_object* pobj = Z_OBJ_P(getThis()); 
1314 1314
    xsltProcessor_object *obj = (xsltProcessor_object *)((char *)pobj - XtOffsetOf(xsltProcessor_object, std));
1315 1315
    xsltProcessor = obj->xsltProcessor;
1316
    if (xsltProcessor != NULL && outputFilename != NULL) {
1316
    if (xsltProcessor != nullptr && outputFilename != nullptr) {
1317 1317
        
1318 1318
	 xsltProcessor->setOutputFile(outputFilename);
1319 1319
            
......
1325 1325
PHP_METHOD(XsltProcessor, setBaseOutputURI)
1326 1326
{
1327 1327
    XsltProcessor *xsltProcessor;
1328
    char * baseOutputURI = NULL;
1328
    char * baseOutputURI = nullptr;
1329 1329
    size_t len1;
1330 1330

  
1331 1331
    if (zend_parse_parameters(ZEND_NUM_ARGS() , "s", &baseOutputURI, &len1) == FAILURE) {
......
1335 1335
    zend_object* pobj = Z_OBJ_P(getThis());
1336 1336
    xsltProcessor_object *obj = (xsltProcessor_object *)((char *)pobj - XtOffsetOf(xsltProcessor_object, std));
1337 1337
    xsltProcessor = obj->xsltProcessor;
1338
    if (xsltProcessor != NULL && baseOutputURI != NULL) {
1338
    if (xsltProcessor != nullptr && baseOutputURI != nullptr) {
1339 1339

  
1340 1340
	 xsltProcessor->setBaseOutputURI(baseOutputURI);
1341 1341

  
......
1360 1360
    zend_object* pobj = Z_OBJ_P(getThis()); 
1361 1361
    xsltProcessor_object *obj = (xsltProcessor_object *)((char *)pobj - XtOffsetOf(xsltProcessor_object, std));
1362 1362
    xsltProcessor = obj->xsltProcessor;
1363
    if (xsltProcessor != NULL && inFilename != NULL) {
1363
    if (xsltProcessor != nullptr && inFilename != nullptr) {
1364 1364
	 xsltProcessor->setSourceFromFile(inFilename);
1365 1365
            
1366 1366
        
......
1381 1381
    zend_object* pobj = Z_OBJ_P(getThis()); 
1382 1382
    xsltProcessor_object *obj = (xsltProcessor_object *)((char *)pobj - XtOffsetOf(xsltProcessor_object, std));
1383 1383
    xsltProcessor = obj->xsltProcessor;
1384
    if (xsltProcessor != NULL) {
1384
    if (xsltProcessor != nullptr) {
1385 1385
        xsltProcessor->setProperty(name, value);
1386 1386
    }
1387 1387
}
......
1399 1399
    zend_object* pobj = Z_OBJ_P(getThis()); 
1400 1400
    xsltProcessor_object *obj = (xsltProcessor_object *)((char *)pobj - XtOffsetOf(xsltProcessor_object, std));
1401 1401
    xsltProcessor = obj->xsltProcessor;
1402
    if (xsltProcessor != NULL) {
1402
    if (xsltProcessor != nullptr) {
1403 1403
	if(Z_TYPE_P(oth) ==IS_NULL){
1404
		php_error(E_WARNING, "Error setting source value - value is null");
1404
		php_error(E_WARNING, "Error setting source value - value is nullptr");
1405 1405
		return;
1406 1406
	}
1407 1407

  
......
1411 1411
      if(strcmp(objName, "Saxon\\XdmNode")==0) {
1412 1412
	zend_object* ooth = Z_OBJ_P(oth);
1413 1413
	xdmNode_object * nobj = (xdmNode_object *)((char *)ooth - XtOffsetOf(xdmNode_object, std));
1414
        if(nobj != NULL) {
1414
        if(nobj != nullptr) {
1415 1415
            XdmNode * value = nobj->xdmNode;
1416
            if(value != NULL) {	
1416
            if(value != nullptr) {
1417 1417
	        xsltProcessor->setParameter(name, (XdmValue *)value);
1418 1418

  
1419 1419
            }
......
1421 1421
      } else if(strcmp(objName, "Saxon\\XdmValue")==0){
1422 1422
	zend_object* ooth = Z_OBJ_P(oth);
1423 1423
	xdmValue_object * vobj = (xdmValue_object *)((char *)ooth - XtOffsetOf(xdmValue_object, std));
1424
        if(vobj != NULL) {
1424
        if(vobj != nullptr) {
1425 1425
            XdmValue * value = vobj->xdmValue;
1426
            if(value != NULL) {
1426
            if(value != nullptr) {
1427 1427
		
1428 1428
                xsltProcessor->setParameter(name, value);
1429 1429
            }
......
1434 1434
      } else if(strcmp(objName, "Saxon\\XdmAtomicValue")==0){
1435 1435
	zend_object* ooth = Z_OBJ_P(oth);
1436 1436
	xdmAtomicValue_object * aobj = (xdmAtomicValue_object *)((char *)ooth - XtOffsetOf(xdmAtomicValue_object, std));
1437
        if(aobj != NULL) {
1437
        if(aobj != nullptr) {
1438 1438
            XdmAtomicValue * value = aobj->xdmAtomicValue;
1439
            if(value != NULL) {
1439
            if(value != nullptr) {
1440 1440
                xsltProcessor->setParameter(name, (XdmValue *)value);
1441 1441
            }
1442 1442
        }
......
1458 1458
    zend_object* pobj = Z_OBJ_P(getThis()); 
1459 1459
    xsltProcessor_object *obj = (xsltProcessor_object *)((char *)pobj - XtOffsetOf(xsltProcessor_object, std));
1460 1460
    xsltProcessor = obj->xsltProcessor;
1461
    if (xsltProcessor != NULL) {
1461
    if (xsltProcessor != nullptr) {
1462 1462
        xsltProcessor->clearParameters(true);
1463 1463
    }
1464 1464
}
......
1473 1473
    zend_object* pobj = Z_OBJ_P(getThis()); 
1474 1474
    xsltProcessor_object *obj = (xsltProcessor_object *)((char *)pobj - XtOffsetOf(xsltProcessor_object, std));
1475 1475
    xsltProcessor = obj->xsltProcessor;
1476
    if (xsltProcessor != NULL) {
1476
    if (xsltProcessor != nullptr) {
1477 1477
        xsltProcessor->clearProperties();
1478 1478
    }
1479 1479
}
......
1484 1484
{
1485 1485
    XsltProcessor *xsltProcessor;
1486 1486
    bool show = false;
1487
    char * filename = NULL;
1487
    char * filename = nullptr;
1488 1488
    size_t len1;
1489 1489
    if (zend_parse_parameters(ZEND_NUM_ARGS() , "bs", &show, &filename &len1) == FAILURE) {
1490 1490
        RETURN_NULL();
......
1494 1494
    xsltProcessor_object *obj = (xsltProcessor_object *)((char *)pobj - XtOffsetOf(xsltProcessor_object, std));
1495 1495
    xsltProcessor = obj->xsltProcessor;
1496 1496

  
1497
    if (xsltProcessor != NULL) {
1497
    if (xsltProcessor != nullptr) {
1498 1498

  
1499 1499
	    xsltProcessor->setupXslMessage(show, filename);
1500 1500
	}
......
1513 1513
    }
1514 1514

  
1515 1515
    xsltProcessor = obj->xsltProcessor;
1516
    if (xsltProcessor != NULL) {
1516
    if (xsltProcessor != nullptr) {
1517 1517
        bool result = xsltProcessor->exceptionOccurred();
1518 1518
        RETURN_BOOL(result);
1519 1519
    }
......
1530 1530
    }
1531 1531

  
1532 1532
    xsltProcessor = obj->xsltProcessor;
1533
    if (xsltProcessor != NULL) {
1533
    if (xsltProcessor != nullptr) {
1534 1534
        int count = xsltProcessor->exceptionCount();
1535 1535
        RETURN_LONG(count);
1536 1536
    }
......
1547 1547
    zend_object* pobj = Z_OBJ_P(getThis()); 
1548 1548
    xsltProcessor_object *obj = (xsltProcessor_object *)((char *)pobj - XtOffsetOf(xsltProcessor_object, std));
1549 1549
    xsltProcessor = obj->xsltProcessor;
1550
    if (xsltProcessor != NULL) {
1550
    if (xsltProcessor != nullptr) {
1551 1551
        const char * errCode = xsltProcessor->getErrorCode((int)index);
1552
        if(errCode != NULL) {
1552
        if(errCode != nullptr) {
1553 1553
            //char *str = estrdup(errCode);
1554 1554
            _RETURN_STRING(errCode);
1555 1555
        }
......
1567 1567
    zend_object* pobj = Z_OBJ_P(getThis()); 
1568 1568
    xsltProcessor_object *obj = (xsltProcessor_object *)((char *)pobj - XtOffsetOf(xsltProcessor_object, std));
1569 1569
    xsltProcessor = obj->xsltProcessor;
1570
    if (xsltProcessor != NULL) {
1570
    if (xsltProcessor != nullptr) {
1571 1571
        const char * errStr = xsltProcessor->getErrorMessage((int)index);
1572
        if(errStr != NULL) {
1572
        if(errStr != nullptr) {
1573 1573
            //char *str = estrdup(errStr);
1574 1574
            _RETURN_STRING(errStr);
1575 1575
        }
......
1582 1582
    zend_object* pobj = Z_OBJ_P(getThis()); 
1583 1583
    xsltProcessor_object *obj = (xsltProcessor_object *)((char *)pobj - XtOffsetOf(xsltProcessor_object, std));
1584 1584
    xsltProcessor = obj->xsltProcessor;
1585
    if (xsltProcessor != NULL) {
1585
    if (xsltProcessor != nullptr) {
1586 1586
        xsltProcessor->exceptionClear();
1587 1587
    }
1588 1588
}
......
1630 1630

  
1631 1631

  
1632 1632
    Xslt30Processor * xslt30Processor= obj->xslt30Processor;
1633
    if(xslt30Processor != NULL){
1633
    if(xslt30Processor != nullptr){
1634 1634
    	delete xslt30Processor;
1635 1635
     }
1636 1636

  
......
1641 1641
PHP_METHOD(Xslt30Processor, setBaseOutputURI)
1642 1642
{
1643 1643
    Xslt30Processor *xslt30Processor;
1644
    char * baseOutputURI = NULL;
1644
    char * baseOutputURI = nullptr;
1645 1645
    size_t len1;
1646 1646

  
1647 1647
    if (zend_parse_parameters(ZEND_NUM_ARGS() , "s", &baseOutputURI, &len1) == FAILURE) {
......
1651 1651
    zend_object* pobj = Z_OBJ_P(getThis());
1652 1652
    xslt30Processor_object *obj = (xslt30Processor_object *)((char *)pobj - XtOffsetOf(xslt30Processor_object, std));
1653 1653
    xslt30Processor = obj->xslt30Processor;
1654
    if (xslt30Processor != NULL && baseOutputURI != NULL) {
1654
    if (xslt30Processor != nullptr && baseOutputURI != nullptr) {
1655 1655

  
1656 1656
	 xslt30Processor->setBaseOutputURI(baseOutputURI);
1657 1657

  
......
1671 1671
    zval * arguments_zval;
1672 1672
    zval * val;
1673 1673
    long num_key;
1674
    XdmValue ** arguments = NULL;
1674
    XdmValue ** arguments = nullptr;
1675 1675
    int argument_length=0;
1676 1676
    zend_string *key;
1677 1677

  
1678 1678
    char * infilename;
1679
    char * styleFileName = NULL;
1679
    char * styleFileName = nullptr;
1680 1680
    size_t len1, len2;
1681 1681

  
1682 1682
    if (ZEND_NUM_ARGS()==2 && zend_parse_parameters(ZEND_NUM_ARGS() , "sa", &functionName, &len2, &arguments_zval) == FAILURE) {
......
1693 1693
   
1694 1694
    arguments = new XdmValue*[argument_length];
1695 1695
      
1696
    if (xslt30Processor != NULL) {
1696
    if (xslt30Processor != nullptr) {
1697 1697
      ZEND_HASH_FOREACH_KEY_VAL(arr_hash, num_key, key, val) {
1698
        if(Z_TYPE_P(val) != NULL) {
1698
        if(Z_TYPE_P(val) != nullptr) {
1699 1699
	const char * objName =ZSTR_VAL(Z_OBJCE_P(val)->name);
1700 1700
      /*std::cerr<<"test type:"<<(Z_OBJCE_P(val)->name)<<std::endl;
1701 1701
	php_printf("num_key %d =>", num_key);
......
1704 1704
	if(strcmp(objName, "Saxon\\XdmNode")==0) {
1705 1705
		zend_object* ooth = Z_OBJ_P(val);
1706 1706
		xdmNode_object * nobj = (xdmNode_object *)((char *)ooth - XtOffsetOf(xdmNode_object, std));
1707
        	if(nobj != NULL) {
1707
        	if(nobj != nullptr) {
1708 1708
            		XdmValue * value = (XdmValue *) nobj->xdmNode;
1709 1709
            		arguments[num_key] = value;
1710 1710
        	}
......
1712 1712
	else if(strcmp(objName, "Saxon\\XdmAtomicValue")==0) {
1713 1713
		zend_object* ooth = Z_OBJ_P(val);
1714 1714
		xdmAtomicValue_object * nobj = (xdmAtomicValue_object *)((char *)ooth - XtOffsetOf(xdmAtomicValue_object, std));
1715
        	if(nobj != NULL) {
1715
        	if(nobj != nullptr) {
1716 1716
            		XdmValue * value = (XdmValue *) nobj->xdmAtomicValue;
1717 1717
            		arguments[num_key] = value;
1718 1718
        	}
......
1720 1720
	else if(strcmp(objName, "Saxon\\XdmValue")==0) {
1721 1721
		zend_object* ooth = Z_OBJ_P(val);
1722 1722
		xdmValue_object * nobj = (xdmValue_object *)((char *)ooth - XtOffsetOf(xdmValue_object, std));
1723
        	if(nobj != NULL) {
1723
        	if(nobj != nullptr) {
1724 1724
            		XdmValue * value = nobj->xdmValue;
1725 1725
            		arguments[num_key] = value;
1726 1726
        	}
......
1734 1734

  
1735 1735
	//php_printf(" argument_length= %d",argument_length);
1736 1736
        XdmValue * result = xslt30Processor->callFunctionReturningValue(styleFileName, functionName, arguments, argument_length);
1737
	if(result != NULL) {
1737
	if(result != nullptr) {
1738 1738
            if (object_init_ex(return_value, xdmValue_ce) != SUCCESS) {
1739 1739
                RETURN_NULL();
1740 1740
            } else {
1741 1741
		zend_object *ooth =  Z_OBJ_P(return_value);
1742 1742
                //struct xdmValue_object* vobj = (struct xdmValue_object *)Z_OBJ_P(return_value TSRMLS_CC);
1743 1743
		xdmValue_object* vobj  = (xdmValue_object *)((char *)ooth - XtOffsetOf(xdmValue_object, std));
1744
                assert (vobj != NULL);
1744
                assert (vobj != nullptr);
1745 1745
                vobj->xdmValue = result;
1746 1746
            }
1747 1747
        } else {
......
1762 1762
    zval * arguments_zval;
1763 1763
    zval * val;
1764 1764
    long num_key;
1765
    XdmValue ** arguments = NULL;
1765
    XdmValue ** arguments = nullptr;
1766 1766
    int argument_length=0;
1767 1767
    zend_string *key;
1768 1768

  
1769 1769
    char * infilename;
1770
    char * styleFileName = NULL;
1770
    char * styleFileName = nullptr;
1771 1771
    size_t len1, len2;
1772 1772

  
1773 1773
     if (ZEND_NUM_ARGS()==2 && zend_parse_parameters(ZEND_NUM_ARGS() , "sa", &functionName, &len2, &arguments_zval) == FAILURE) {
......
1784 1784
   
1785 1785
    arguments = new XdmValue*[argument_length];
1786 1786
      
1787
    if (xslt30Processor != NULL) {
1787
    if (xslt30Processor != nullptr) {
1788 1788
      ZEND_HASH_FOREACH_KEY_VAL(arr_hash, num_key, key, val) {
1789
        if(Z_TYPE_P(val) != NULL) {
1789
        if(Z_TYPE_P(val) != nullptr) {
1790 1790
	const char * objName =ZSTR_VAL(Z_OBJCE_P(val)->name);
1791 1791
      /*std::cerr<<"test type:"<<(Z_OBJCE_P(val)->name)<<std::endl;
1792 1792
	php_printf("num_key %d =>", num_key);
......
1795 1795
	if(strcmp(objName, "Saxon\\XdmNode")==0) {
1796 1796
		zend_object* ooth = Z_OBJ_P(val);
1797 1797
		xdmNode_object * nobj = (xdmNode_object *)((char *)ooth - XtOffsetOf(xdmNode_object, std));
1798
        	if(nobj != NULL) {
1798
        	if(nobj != nullptr) {
1799 1799
            		XdmValue * value = (XdmValue *) nobj->xdmNode;
1800 1800
            		arguments[num_key] = value;
1801 1801
        	}
......
1803 1803
	else if(strcmp(objName, "Saxon\\XdmAtomicValue")==0) {
1804 1804
		zend_object* ooth = Z_OBJ_P(val);
1805 1805
		xdmAtomicValue_object * nobj = (xdmAtomicValue_object *)((char *)ooth - XtOffsetOf(xdmAtomicValue_object, std));
1806
        	if(nobj != NULL) {
1806
        	if(nobj != nullptr) {
1807 1807
            		XdmValue * value = (XdmValue *) nobj->xdmAtomicValue;
1808 1808
            		arguments[num_key] = value;
1809 1809
        	}
......
1811 1811
	else if(strcmp(objName, "Saxon\\XdmValue")==0) {
1812 1812
		zend_object* ooth = Z_OBJ_P(val);
1813 1813
		xdmValue_object * nobj = (xdmValue_object *)((char *)ooth - XtOffsetOf(xdmValue_object, std));
1814
        	if(nobj != NULL) {
1814
        	if(nobj != nullptr) {
1815 1815
            		XdmValue * value = nobj->xdmValue;
1816 1816
            		arguments[num_key] = value;
1817 1817
        	}
......
1823 1823
      } ZEND_HASH_FOREACH_END();
1824 1824

  
1825 1825
        const char * result = xslt30Processor->callFunctionReturningString(styleFileName, functionName, arguments, argument_length);
1826
	if(result != NULL) {
1826
	if(result != nullptr) {
1827 1827
            //char *str = estrdup(result);
1828 1828
            _RETURN_STRING(result);
1829 1829
        } else if(xslt30Processor->exceptionOccurred()){
1830 1830
            //TODO: xslt30Processor->checkException();
1831 1831
            const char * errStr = xslt30Processor->getErrorMessage(0);
1832
            if(errStr != NULL) {
1832
            if(errStr != nullptr) {
1833 1833
                const char * errorCode = xslt30Processor->getErrorCode(0);
1834
                if(errorCode!=NULL) {
1834
                if(errorCode!=nullptr) {
1835 1835
                    // TODO: throw exception
1836 1836
                }
1837 1837
            }
......
1850 1850
    zval * arguments_zval;
1851 1851
    zval * val;
1852 1852
    long num_key;
1853
    XdmValue ** arguments = NULL;
1853
    XdmValue ** arguments = nullptr;
1854 1854
    int argument_length=0;
1855 1855
    zend_string *key;
1856 1856

  
1857 1857
    char * outfilename;
1858
    char * styleFileName = NULL;
1858
    char * styleFileName = nullptr;
1859 1859
    size_t len1, len2, len3;
1860 1860

  
1861 1861

  
......
1873 1873
   
1874 1874
    arguments = new XdmValue*[argument_length];
1875 1875
      
1876
    if (xslt30Processor != NULL) {
1876
    if (xslt30Processor != nullptr) {
1877 1877
      ZEND_HASH_FOREACH_KEY_VAL(arr_hash, num_key, key, val) {
1878
        if(Z_TYPE_P(val) != NULL) {
1878
        if(Z_TYPE_P(val) != nullptr) {
1879 1879
	const char * objName =ZSTR_VAL(Z_OBJCE_P(val)->name);
1880 1880
      /*std::cerr<<"test type:"<<(Z_OBJCE_P(val)->name)<<std::endl;
1881 1881
	php_printf("num_key %d =>", num_key);
......
1884 1884
	if(strcmp(objName, "Saxon\\XdmNode")==0) {
1885 1885
		zend_object* ooth = Z_OBJ_P(val);
1886 1886
		xdmNode_object * nobj = (xdmNode_object *)((char *)ooth - XtOffsetOf(xdmNode_object, std));
1887
        	if(nobj != NULL) {
1887
        	if(nobj != nullptr) {
1888 1888
            		XdmValue * value = (XdmValue *) nobj->xdmNode;
1889 1889
            		arguments[num_key] = value;
1890 1890
        	}
......
1892 1892
	else if(strcmp(objName, "Saxon\\XdmAtomicValue")==0) {
1893 1893
		zend_object* ooth = Z_OBJ_P(val);
1894 1894
		xdmAtomicValue_object * nobj = (xdmAtomicValue_object *)((char *)ooth - XtOffsetOf(xdmAtomicValue_object, std));
1895
        	if(nobj != NULL) {
1895
        	if(nobj != nullptr) {
1896 1896
            		XdmValue * value = (XdmValue *) nobj->xdmAtomicValue;
1897 1897
            		arguments[num_key] = value;
1898 1898
        	}
......
1900 1900
	else if(strcmp(objName, "Saxon\\XdmValue")==0) {
1901 1901
		zend_object* ooth = Z_OBJ_P(val);
1902 1902
		xdmValue_object * nobj = (xdmValue_object *)((char *)ooth - XtOffsetOf(xdmValue_object, std));
1903
        	if(nobj != NULL) {
1903
        	if(nobj != nullptr) {
1904 1904
            		XdmValue * value = nobj->xdmValue;
1905 1905
            		arguments[num_key] = value;
1906 1906
        	}
......
1916 1916
	if(xslt30Processor->exceptionOccurred()){
1917 1917
            //TODO: xslt30Processor->checkException();
1918 1918
            const char * errStr = xslt30Processor->getErrorMessage(0);
1919
            if(errStr != NULL) {
1919
            if(errStr != nullptr) {
1920 1920
                const char * errorCode = xslt30Processor->getErrorCode(0);
1921 1921
            }
1922 1922
        }
......
1927 1927
    PHP_METHOD(Xslt30Processor, callTemplateReturningValue){
1928 1928

  
1929 1929
  Xslt30Processor *xslt30Processor;
1930
    char* templateName = NULL;
1930
    char* templateName = nullptr;
1931 1931
   
1932
    char * styleFileName = NULL;
1932
    char * styleFileName = nullptr;
1933 1933
    size_t len1, len2;
1934 1934

  
1935 1935

  
......
1944 1944
    xslt30Processor_object *obj = (xslt30Processor_object *)((char *)pobj - XtOffsetOf(xslt30Processor_object, std));
1945 1945
    xslt30Processor = obj->xslt30Processor;
1946 1946
      
1947
    if (xslt30Processor != NULL) {
1947
    if (xslt30Processor != nullptr) {
1948 1948
   
1949 1949

  
1950 1950
	//php_printf(" argument_length= %d",argument_length);
1951 1951
        XdmValue * result = xslt30Processor->callTemplateReturningValue(styleFileName, templateName);
1952
	if(result != NULL) {
1952
	if(result != nullptr) {
1953 1953
 
1954 1954
            if (object_init_ex(return_value, xdmValue_ce) != SUCCESS) { 
1955 1955
               RETURN_NULL();
......
1957 1957
		zend_object *ooth =  Z_OBJ_P(return_value);
1958 1958
              
1959 1959
		xdmValue_object* vobj  = (xdmValue_object *)((char *)ooth - XtOffsetOf(xdmValue_object, std));
1960
                assert (vobj != NULL);
1960
                assert (vobj != nullptr);
1961 1961
                vobj->xdmValue = result;
1962 1962
		
1963 1963
            }
......
1973 1973

  
1974 1974
    PHP_METHOD(Xslt30Processor, callTemplateReturningString){
1975 1975
    Xslt30Processor *xslt30Processor;
1976
    char* templateName = NULL;
1976
    char* templateName = nullptr;
1977 1977
   
1978
    char * styleFileName = NULL;
1978
    char * styleFileName = nullptr;
1979 1979
    size_t len1, len2;
1980 1980

  
1981 1981
    if (ZEND_NUM_ARGS()==1 && zend_parse_parameters(ZEND_NUM_ARGS() , "s", &templateName, &len2) == FAILURE) {
......
1990 1990
    xslt30Processor_object *obj = (xslt30Processor_object *)((char *)pobj - XtOffsetOf(xslt30Processor_object, std));
1991 1991
    xslt30Processor = obj->xslt30Processor;
1992 1992
      
1993
    if (xslt30Processor != NULL) {
1993
    if (xslt30Processor != nullptr) {
1994 1994
   
1995 1995

  
1996 1996
	//php_printf(" argument_length= %d",argument_length);
1997 1997
        const char * result = xslt30Processor->callTemplateReturningString(styleFileName, templateName);
1998
	if(result != NULL) {
1998
	if(result != nullptr) {
1999 1999
            _RETURN_STRING(result); 
2000 2000
        } else {
2001 2001
            if(xslt30Processor->exceptionOccurred()){
2002 2002
            xslt30Processor->checkException();
2003 2003
            const char * errStr = xslt30Processor->getErrorMessage(0);
2004
            if(errStr != NULL) {
2004
            if(errStr != nullptr) {
2005 2005
                const char * errorCode = xslt30Processor->getErrorCode(0);
2006
                if(errorCode!=NULL) {
2006
                if(errorCode!=nullptr) {
2007 2007
                    // TODO: throw exception
2008 2008
                }
2009 2009
            }
......
2016 2016

  
2017 2017
    PHP_METHOD(Xslt30Processor, callTemplateReturningFile){
2018 2018
   Xslt30Processor *xslt30Processor;
2019
    char* templateName = NULL;
2020
    char * filename = NULL;
2021
    char * styleFileName = NULL;
2019
    char* templateName = nullptr;
2020
    char * filename = nullptr;
2021
    char * styleFileName = nullptr;
2022 2022
    size_t len1, len2, len3;
2023 2023

  
2024 2024
    if (ZEND_NUM_ARGS()==1 && zend_parse_parameters(ZEND_NUM_ARGS() , "s", &templateName, &len2) == FAILURE) {
......
2033 2033
    xslt30Processor_object *obj = (xslt30Processor_object *)((char *)pobj - XtOffsetOf(xslt30Processor_object, std));
2034 2034
    xslt30Processor = obj->xslt30Processor;
2035 2035
      
2036
    if (xslt30Processor != NULL) {
2036
    if (xslt30Processor != nullptr) {
2037 2037
   	xslt30Processor->callTemplateReturningFile(styleFileName, templateName, filename);
2038 2038
    }
2039 2039

  
......
2042 2042

  
2043 2043
PHP_METHOD(Xslt30Processor, applyTemplatesReturningValue){
2044 2044
   Xslt30Processor *xslt30Processor;
2045
    char * styleFileName = NULL;
2045
    char * styleFileName = nullptr;
2046 2046
    size_t len1;
2047 2047

  
2048 2048
    if (ZEND_NUM_ARGS()>0) {
......
2056 2056
    xslt30Processor_object *obj = (xslt30Processor_object *)((char *)pobj - XtOffsetOf(xslt30Processor_object, std));
2057 2057
    xslt30Processor = obj->xslt30Processor;
2058 2058
      
2059
    if (xslt30Processor != NULL) {
2059
    if (xslt30Processor != nullptr) {
2060 2060
   	XdmValue * result = xslt30Processor->applyTemplatesReturningValue(styleFileName);
2061 2061
    
2062
	if(result != NULL) {
2062
	if(result != nullptr) {
2063 2063
            if (object_init_ex(return_value, xdmValue_ce) != SUCCESS) {
2064 2064
                RETURN_NULL();
2065 2065
            } else {
2066 2066
		zend_object *ooth =  Z_OBJ_P(return_value);
2067 2067
        	xdmValue_object* vobj  = (xdmValue_object *)((char *)ooth - XtOffsetOf(xdmValue_object, std));
2068
                assert (vobj != NULL);
2068
                assert (vobj != nullptr);
2069 2069
                vobj->xdmValue = result;
2070 2070
            }
2071 2071
        } else {
......
2086 2086
PHP_METHOD(Xslt30Processor, applyTemplatesReturningString){
2087 2087
 Xslt30Processor *xslt30Processor;
2088 2088

  
2089
    char * styleFileName = NULL;
2089
    char * styleFileName = nullptr;
2090 2090
    size_t len1;
2091 2091

  
2092 2092

  
......
2101 2101
    xslt30Processor_object *obj = (xslt30Processor_object *)((char *)pobj - XtOffsetOf(xslt30Processor_object, std));
2102 2102
    xslt30Processor = obj->xslt30Processor;
2103 2103
      
2104
    if (xslt30Processor != NULL) {
2104
    if (xslt30Processor != nullptr) {
2105 2105
        const char * result = xslt30Processor->applyTemplatesReturningString(styleFileName);
2106 2106
   
2107
	if(result != NULL) {
2107
	if(result != nullptr) {
2108 2108
            _RETURN_STRING(result); 
2109 2109
        } else {
2110 2110
            if(xslt30Processor->exceptionOccurred()){
2111 2111
            xslt30Processor->checkException();
2112 2112
            const char * errStr = xslt30Processor->getErrorMessage(0);
2113
            if(errStr != NULL) {
2113
            if(errStr != nullptr) {
2114 2114
                const char * errorCode = xslt30Processor->getErrorCode(0);
2115
                if(errorCode!=NULL) {
2115
                if(errorCode!=nullptr) {
2116 2116
                    // TODO: throw exception
2117 2117
                }
2118 2118
            }
......
2130 2130

  
2131 2131
PHP_METHOD(Xslt30Processor, applyTemplatesReturningFile){
2132 2132
 Xslt30Processor *xslt30Processor;
2133
    char * filename = NULL;
2134
    char * styleFileName = NULL;
2133
    char * filename = nullptr;
2134
    char * styleFileName = nullptr;
2135 2135
    size_t len1, len2;
2136 2136

  
2137 2137
    if (ZEND_NUM_ARGS()==2 && zend_parse_parameters(ZEND_NUM_ARGS() , "ss", &styleFileName, &len1, &filename, &len2) == FAILURE) {
......
2147 2147
    xslt30Processor_object *obj = (xslt30Processor_object *)((char *)pobj - XtOffsetOf(xslt30Processor_object, std));
2148 2148
    xslt30Processor = obj->xslt30Processor;
2149 2149
      
2150
    if (xslt30Processor != NULL) {
2150
    if (xslt30Processor != nullptr) {
2151 2151
   	xslt30Processor->applyTemplatesReturningFile(styleFileName, filename);
2152 2152
    }
2153 2153

  
......
2159 2159
/*PHP_METHOD(Xslt30Processor, addPackages){
2160 2160
    HashTable *arr_hash;
2161 2161
    Xslt30Processor *xslt30Processor;
2162
    char* functionName = NULL;
2162
    char* functionName = nullptr;
2163 2163
    zval * arguments_zval;
2164 2164
    zval * val;
2165 2165
    long num_key;
2166
    const char ** arguments = NULL;
2166
    const char ** arguments = nullptr;
2167 2167
    int argument_length=0;
2168 2168
    zend_string *key;
2169 2169

  
2170
    char * infilename = NULL;
2171
    char * styleFileName = NULL;
2170
    char * infilename = nullptr;
2171
    char * styleFileName = nullptr;
2172 2172
    size_t len1, len2;
2173 2173

  
2174 2174
        if (zend_parse_parameters(ZEND_NUM_ARGS() , "a", &arguments_zval) == FAILURE) {
......
2183 2183
   
2184 2184
    arguments = new const char*[argument_length];
2185 2185

  
2186
  if (xslt30Processor != NULL) {
2186
  if (xslt30Processor != nullptr) {
2187 2187
      ZEND_HASH_FOREACH_KEY_VAL(arr_hash, num_key, key, val) {
2188
        if(Z_TYPE_P(val) != NULL && Z_TYPE_P(val)== IS_STRING) {
2188
        if(Z_TYPE_P(val) != nullptr && Z_TYPE_P(val)== IS_STRING) {
2189 2189

  
2190 2190
		arguments[num_key] = (const char*)Z_STRVAL_P(val);
2191 2191
     		
......
2196 2196
	if(xslt30Processor->exceptionOccurred()){
2197 2197
            //TODO: xslt30Processor->checkException();
2198 2198
            const char * errStr = xslt30Processor->getErrorMessage(0);
2199
            if(errStr != NULL) {
2199
            if(errStr != nullptr) {
2200 2200
                const char * errorCode = xslt30Processor->getErrorCode(0);
2201 2201
            }
2202 2202
        }
......
2233 2233
   
2234 2234
    arguments = new XdmValue*[argument_length];
2235 2235
    std::map<std::string,XdmValue*> parameters;
2236
    if (xslt30Processor != NULL) {
2236
    if (xslt30Processor != nullptr) {
2237 2237
      ZEND_HASH_FOREACH_KEY_VAL(arr_hash, num_key, key, val) {
2238
        if(Z_TYPE_P(val) != NULL) {
2238
        if(Z_TYPE_P(val) != nullptr) {
2239 2239
	const char * objName =ZSTR_VAL(Z_OBJCE_P(val)->name);
2240 2240
      /*std::cerr<<"test type:"<<(Z_OBJCE_P(val)->name)<<std::endl;
2241 2241
	php_printf("num_key %d =>", num_key);
......
2244 2244
	if(strcmp(objName, "Saxon\\XdmNode")==0) {
2245 2245
		zend_object* ooth = Z_OBJ_P(val);
2246 2246
		xdmNode_object * nobj = (xdmNode_object *)((char *)ooth - XtOffsetOf(xdmNode_object, std));
2247
        	if(nobj != NULL) {
2247
        	if(nobj != nullptr) {
2248 2248
            		XdmValue * value = (XdmValue *) nobj->xdmNode;
2249 2249
            		parameters[ZSTR_VAL(key)] = value;
2250 2250
        	}
......
2252 2252
	else if(strcmp(objName, "Saxon\\XdmAtomicValue")==0) {
2253 2253
		zend_object* ooth = Z_OBJ_P(val);
2254 2254
		xdmAtomicValue_object * nobj = (xdmAtomicValue_object *)((char *)ooth - XtOffsetOf(xdmAtomicValue_object, std));
2255
        	if(nobj != NULL) {
2255
        	if(nobj != nullptr) {
2256 2256
            		XdmValue * value = (XdmValue *) nobj->xdmAtomicValue;
2257 2257
            		parameters[ZSTR_VAL(key)] = value;
2258 2258
        	}
......
2260 2260
	else if(strcmp(objName, "Saxon\\XdmValue")==0) {
2261 2261
		zend_object* ooth = Z_OBJ_P(val);
2262 2262
		xdmValue_object * nobj = (xdmValue_object *)((char *)ooth - XtOffsetOf(xdmValue_object, std));
2263
        	if(nobj != NULL) {
2263
        	if(nobj != nullptr) {
2264 2264
            		XdmValue * value = nobj->xdmValue;
2265 2265
            		parameters[ZSTR_VAL(key)] = value;
2266 2266
        	}
......
2282 2282

  
2283 2283
PHP_METHOD(Xslt30Processor, setInitialMatchSelection){
2284 2284
   Xslt30Processor *xslt30Processor;
2285
    zval* oth = NULL;
2285
    zval* oth = nullptr;
2286 2286

  
2287 2287
    if (zend_parse_parameters(ZEND_NUM_ARGS() , "z", &oth) == FAILURE) {
2288 2288
        RETURN_NULL();
......
2291 2291
    zend_object* pobj = Z_OBJ_P(getThis());
2292 2292
    xslt30Processor_object *obj = (xslt30Processor_object *)((char *)pobj - XtOffsetOf(xslt30Processor_object, std));
2293 2293
    xslt30Processor = obj->xslt30Processor;
2294
    if (xslt30Processor != NULL) {
2294
    if (xslt30Processor != nullptr) {
2295 2295

  
2296 2296
    if(!oth) {
2297 2297
	php_error(E_WARNING, "Error setting source value");
2298 2298
	return;
2299 2299
    } else {
2300 2300
	if(Z_TYPE_P(oth) ==IS_NULL){
2301
		php_error(E_WARNING, "Error setting source value - NULL found");
2301
		php_error(E_WARNING, "Error setting source value - nullptr found");
2302 2302
		return;
2303 2303
	}
2304 2304

  
......
2310 2310
	zend_object * nobj = Z_OBJ_P(oth);
2311 2311

  
2312 2312
	xdmValue_object* ooth = (xdmValue_object *)((char *)nobj - XtOffsetOf(xdmValue_object, std));//(xdmNode_object*)Z_OBJ_P(oth);
2313
        if(ooth != NULL) {
2313
        if(ooth != nullptr) {
2314 2314
            XdmValue * value = ooth->xdmValue;
2315
            if(value != NULL) {
2315
            if(value != nullptr) {
2316 2316
		xslt30Processor->setInitialMatchSelection(value);
2317 2317

  
2318 2318
            }
......
2321 2321
	zend_object * nobj = Z_OBJ_P(oth);
2322 2322

  
2323 2323
	xdmNode_object* ooth = (xdmNode_object *)((char *)nobj - XtOffsetOf(xdmNode_object, std));//(xdmNode_object*)Z_OBJ_P(oth);
2324
        if(ooth != NULL) {
2324
        if(ooth != nullptr) {
2325 2325
            XdmNode * value = ooth->xdmNode;
2326
            if(value != NULL) {
2326
            if(value != nullptr) {
2327 2327
		XdmValue  *valueX = (XdmValue*)value;
2328 2328
	        xslt30Processor->setInitialMatchSelection(valueX);
2329 2329

  
......
2336 2336
	zend_object* vvobj = Z_OBJ_P(oth);
2337 2337

  
2338 2338
	xdmAtomicValue_object* ooth = (xdmAtomicValue_object *)((char *)vvobj - XtOffsetOf(xdmAtomicValue_object, std));
2339
        if(ooth != NULL) {
2339
        if(ooth != nullptr) {
2340 2340
            XdmAtomicValue * value = ooth->xdmAtomicValue;
2341
            if(value != NULL) {
2341
            if(value != nullptr) {
2342 2342
	        xslt30Processor->setInitialMatchSelection((XdmValue*)value);
2343 2343
            }
2344 2344
        }
......
2359 2359
PHP_METHOD(Xslt30Processor, setGlobalContextItem)
2360 2360
{
2361 2361
    Xslt30Processor *xslt30Processor;
2362
    zval* oth = NULL;
2362
    zval* oth = nullptr;
2363 2363

  
2364 2364
    if (zend_parse_parameters(ZEND_NUM_ARGS() , "z", &oth) == FAILURE) {
2365 2365
        RETURN_NULL();
......
2368 2368
    zend_object* pobj = Z_OBJ_P(getThis());
2369 2369
    xslt30Processor_object *obj = (xslt30Processor_object *)((char *)pobj - XtOffsetOf(xslt30Processor_object, std));
2370 2370
    xslt30Processor = obj->xslt30Processor;
2371
    if (xslt30Processor != NULL) {
2371
    if (xslt30Processor != nullptr) {
2372 2372

  
2373 2373
    if(!oth) {
2374 2374
	php_error(E_WARNING, "Error setting source value");
......
2386 2386
	zend_object * nobj = Z_OBJ_P(oth);
2387 2387

  
2388 2388
	xdmNode_object* ooth = (xdmNode_object *)((char *)nobj - XtOffsetOf(xdmNode_object, std));//(xdmNode_object*)Z_OBJ_P(oth);
2389
        if(ooth != NULL) {
2389
        if(ooth != nullptr) {
2390 2390
            XdmNode * value = ooth->xdmNode;
2391
            if(value != NULL) {
2391
            if(value != nullptr) {
2392 2392
		XdmItem  *valueX = (XdmItem*)value;
2393 2393
	        xslt30Processor->setGlobalContextItem(valueX);
2394 2394

  
......
2397 2397
      } else if(strcmp(objName, "Saxon\\XdmAtomicValue")==0) {
2398 2398
	zend_object* vvobj = Z_OBJ_P(oth);
2399 2399
	xdmAtomicValue_object* ooth = (xdmAtomicValue_object *)((char *)vvobj - XtOffsetOf(xdmAtomicValue_object, std));
2400
        if(ooth != NULL) {
2400
        if(ooth != nullptr) {
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff