summaryrefslogtreecommitdiff
path: root/community/freewrl/build-fix.patch
blob: c0de71d07d86f88b23256e776e0c78ee334e09ed (plain)
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
diff -wbBur freewrl-1.22.10/src/lib/non_web3d_formats/ColladaParser.c freewrl-1.22.10.my/src/lib/non_web3d_formats/ColladaParser.c
--- freewrl-1.22.10/src/lib/non_web3d_formats/ColladaParser.c	2010-08-19 06:20:36.000000000 +0400
+++ freewrl-1.22.10.my/src/lib/non_web3d_formats/ColladaParser.c	2011-07-04 01:19:07.000000000 +0400
@@ -54,7 +54,7 @@
 #include "ColladaParser.h"
 
 #if HAVE_EXPAT_H
-# include <expat.h>
+# include </usr/include/expat.h>
 #endif
 
 #define PROTOINSTANCE_MAX_LEVELS 10
diff -wbBur freewrl-1.22.10/src/lib/world_script/fieldGet.c freewrl-1.22.10.my/src/lib/world_script/fieldGet.c
--- freewrl-1.22.10/src/lib/world_script/fieldGet.c	2010-10-13 23:45:26.000000000 +0400
+++ freewrl-1.22.10.my/src/lib/world_script/fieldGet.c	2011-07-04 20:21:21.000000000 +0400
@@ -412,7 +412,7 @@
 				/* create a new SFFloat object */
 				
 				fp = (float *)fp_in; 
-				newjsval = DOUBLE_TO_JSVAL(JS_NewDouble(cx,(double)*fp));
+				newjsval = JS_NewJSVal(cx,(double)*fp);
 				fp_in = offsetPointer_deref(float *,fp_in,elementlen);
 
 				/* put this object into the MF class */
@@ -449,7 +449,7 @@
 				/* create a new SFTime object */
 				
 				fp = (float *)fp_in; 
-				newjsval = DOUBLE_TO_JSVAL(JS_NewDouble(cx,(double)*fp));
+				newjsval = JS_NewJSVal(cx,(double)*fp);
 				fp_in = offsetPointer_deref(float *,fp_in,elementlen);
 
 				/* put this object into the MF class */
diff -wbBur freewrl-1.22.10/src/lib/world_script/fieldSet.c freewrl-1.22.10.my/src/lib/world_script/fieldSet.c
--- freewrl-1.22.10/src/lib/world_script/fieldSet.c	2010-09-22 00:00:25.000000000 +0400
+++ freewrl-1.22.10.my/src/lib/world_script/fieldSet.c	2011-07-04 20:03:53.000000000 +0400
@@ -748,7 +748,7 @@
 
 	#ifdef SETFIELDVERBOSE
 	strval = JS_ValueToString(scriptContext, JSglobal_return_val);
-       	strp = JS_GetStringBytes(strval);
+	strp = JS_EncodeString(scriptContext, strval);
 	printf ("start of setField_javascriptEventOut, to %ld:%d = %p, fieldtype %d string %s\n",(long)tn, tptr, memptr, fieldType, strp);
 	#endif
 
@@ -813,7 +813,7 @@
 		case FIELDTYPE_SFImage: {
 			/* the string should be saved as an SFImage */
 			strval = JS_ValueToString(scriptContext, JSglobal_return_val);
-	        	strp = JS_GetStringBytes(strval);
+	        	strp = JS_EncodeString(scriptContext, strval);
 
 			Parser_scanStringValueToMem(tn, tptr, FIELDTYPE_SFImage, strp, FALSE);
 			break;
@@ -824,7 +824,7 @@
 			uintptr_t *newptr;
 
 			strval = JS_ValueToString(scriptContext, JSglobal_return_val);
-	        	strp = JS_GetStringBytes(strval);
+	        	strp = JS_EncodeString(scriptContext, strval);
 
 			/* copy the string over, delete the old one, if need be */
 			/* printf ("fieldSet SFString, tn %d tptr %d offset from struct %d\n",
@@ -844,7 +844,7 @@
 				struct X3D_Node *mynode;
 
 				strval = JS_ValueToString(scriptContext, JSglobal_return_val);
-	        		strp = JS_GetStringBytes(strval);
+	        		strp = JS_EncodeString(scriptContext, strval);
 				
 				/* we will have at least one node here, in an ascii string */
 				while ((*strp > '\0') && (*strp <= ' ')) strp ++;
@@ -1227,7 +1227,7 @@
 			JSString *_tmpStr;
 
 	                _tmpStr = JS_ValueToString(cx, mainElement);
-			strp = JS_GetStringBytes(_tmpStr);
+			strp = JS_EncodeString(scriptContext, _tmpStr);
 	                printf ("sub element %d is \"%s\" \n",i,strp);  
 
 			if (JSVAL_IS_OBJECT(mainElement)) printf ("sub element %d is an OBJECT\n",i);
@@ -1329,7 +1329,7 @@
 				JSString *strval;
 	
 	                        strval = JS_ValueToString(cx, mainElement);
-	                        strp = JS_GetStringBytes(strval);
+	                        strp = JS_EncodeString(cx, strval);
 	
 				#ifdef SETFIELDVERBOSE
 				printf ("getJSMultiNumType, got string %s\n",strp); 
@@ -1441,7 +1441,7 @@
 			return;
 		}
 		strval = JS_ValueToString(cx, _v);
-		valStr = JS_GetStringBytes(strval);
+		valStr = JS_EncodeString(cx, strval);
 
 		/* printf ("new string %d is %s\n",i,valStr); */
 
diff -wbBur freewrl-1.22.10/src/lib/world_script/jsUtils.c freewrl-1.22.10.my/src/lib/world_script/jsUtils.c
--- freewrl-1.22.10/src/lib/world_script/jsUtils.c	2010-06-03 23:38:37.000000000 +0400
+++ freewrl-1.22.10.my/src/lib/world_script/jsUtils.c	2011-07-04 20:21:44.000000000 +0400
@@ -134,7 +134,7 @@
 			nf = OBJECT_TO_JSVAL(me);
 
 			#ifdef JSVRMLCLASSESVERBOSE
-			printf ("parentField is %u \"%s\"\n", pf, JS_GetStringBytes(JSVAL_TO_STRING(pf)));
+			printf ("parentField is %u \"%s\"\n", pf, JS_EncodeString(cx, JSVAL_TO_STRING(pf)));
 			#endif
 
 			if (!setSFNodeField (cx, par, pf, &nf)) {
@@ -197,7 +197,7 @@
         		char *_id_c;
 
         		_idStr = JS_ValueToString(cx, *newval);
-        		_id_c = JS_GetStringBytes(_idStr);
+        		_id_c = JS_EncodeString(cx, _idStr);
 
 			oldS = (struct Uni_String *) *((uintptr_t *)Data);
 
@@ -305,12 +305,12 @@
 
 		case FIELDTYPE_SFFloat:	{
 			memcpy ((void *) &fl, Data, datalen);
-			*newval = DOUBLE_TO_JSVAL(JS_NewDouble(cx,(double)fl));
+			*newval = JS_NewJSVal(cx,(double)fl);
 			break;
 		}
 		case FIELDTYPE_SFTime:	{
 			memcpy ((void *) &dl, Data, datalen);
-			*newval = DOUBLE_TO_JSVAL(JS_NewDouble(cx,dl));
+			*newval = JS_NewJSVal(cx,dl);
 			break;
 		}
 		case FIELDTYPE_SFBool:
@@ -824,7 +824,7 @@
 	struct X3D_Node *node;
 
 	_idStr = JS_ValueToString(context, id);
-	_id_c = JS_GetStringBytes(_idStr);
+	_id_c = JS_EncodeString(context, _idStr);
 	
 	#ifdef JSVRMLCLASSESVERBOSE
 	printf ("\ngetSFNodeField called on name %s object %u\n",_id_c, obj);
@@ -912,7 +912,7 @@
 
 	/* get the id field... */
 
-	_id_c = JS_GetStringBytes(JSVAL_TO_STRING(id));
+	_id_c = JS_EncodeString(context, JSVAL_TO_STRING(id));
 	
 	#ifdef JSVRMLCLASSESVERBOSE
 	printf ("\nsetSFNodeField called on name %s object %u, jsval %u\n",_id_c, obj, *vp);
@@ -1131,10 +1131,10 @@
 	char *_id_c = "(no value in string)";
 	/* get the id field... */
 	if (JSVAL_IS_STRING(id)) { 
-		_id_c = JS_GetStringBytes(JSVAL_TO_STRING(id)); 
+		_id_c = JS_EncodeString(cx, JSVAL_TO_STRING(id)); 
         	/* printf ("hmmm...js_SetPropertyCheck called on string \"%s\" object %u, jsval %u\n",_id_c, obj, *vp); */
 	} else if (JSVAL_IS_DOUBLE(id)) {
-		_id_c = JS_GetStringBytes(JSVAL_TO_STRING(id)); 
+		_id_c = JS_EncodeString(cx, JSVAL_TO_STRING(id)); 
         	printf ("\n...js_SetPropertyCheck called on double %s object %u, jsval %u\n",_id_c, obj, *vp);
 	} else if (JSVAL_IS_INT(id)) {
 		num = JSVAL_TO_INT(id);
@@ -1192,7 +1192,7 @@
 	/* get the id field... */
 
 	if (JSVAL_IS_STRING(id)) { 
-		_id_c = JS_GetStringBytes(JSVAL_TO_STRING(id)); 
+		_id_c = JS_EncodeString(cx, JSVAL_TO_STRING(id)); 
         	printf ("\n...js_GetPropertyDebug called on string \"%s\" object %u, jsval %lu\n",_id_c, (unsigned int) obj, *vp);
 	} else if (JSVAL_IS_INT(id)) {
 		num = JSVAL_TO_INT(id);
@@ -1211,7 +1211,7 @@
 
 	/* get the id field... */
 	if (JSVAL_IS_STRING(id)) { 
-		_id_c = JS_GetStringBytes(JSVAL_TO_STRING(id)); 
+		_id_c = JS_EncodeString(cx, JSVAL_TO_STRING(id)); 
         	printf ("\n...js_SetPropertyDebug called on string \"%s\" object %u, jsval %lu\n",_id_c, (unsigned int) obj, *vp);
 	} else if (JSVAL_IS_INT(id)) {
 		num = JSVAL_TO_INT(id);
@@ -1229,7 +1229,7 @@
 
 	/* get the id field... */
 	if (JSVAL_IS_STRING(id)) { 
-		_id_c = JS_GetStringBytes(JSVAL_TO_STRING(id)); 
+		_id_c = JS_EncodeString(cx, JSVAL_TO_STRING(id)); 
         	printf ("\n...js_SetPropertyDebug1 called on string \"%s\" object %u, jsval %lu\n",_id_c, (unsigned int) obj, *vp);
 	} else if (JSVAL_IS_INT(id)) {
 		num = JSVAL_TO_INT(id);
@@ -1247,7 +1247,7 @@
 
 	/* get the id field... */
 	if (JSVAL_IS_STRING(id)) { 
-		_id_c = JS_GetStringBytes(JSVAL_TO_STRING(id)); 
+		_id_c = JS_EncodeString(cx, JSVAL_TO_STRING(id)); 
         	printf ("...js_SetPropertyDebug2 called on string \"%s\" object %u, jsval %lu\n",_id_c, (unsigned int) obj, *vp);
 	} else if (JSVAL_IS_INT(id)) {
 		num = JSVAL_TO_INT(id);
@@ -1265,7 +1265,7 @@
 
 	/* get the id field... */
 	if (JSVAL_IS_STRING(id)) { 
-		_id_c = JS_GetStringBytes(JSVAL_TO_STRING(id)); 
+		_id_c = JS_EncodeString(context, JSVAL_TO_STRING(id)); 
         	printf ("\n...js_SetPropertyDebug3 called on string \"%s\" object %u, jsval %lu\n",_id_c, (unsigned int) obj, *vp);
 	} else if (JSVAL_IS_INT(id)) {
 		num = JSVAL_TO_INT(id);
@@ -1283,7 +1283,7 @@
 
 	/* get the id field... */
 	if (JSVAL_IS_STRING(id)) { 
-		_id_c = JS_GetStringBytes(JSVAL_TO_STRING(id)); 
+		_id_c = JS_EncodeString(context, JSVAL_TO_STRING(id)); 
         	printf ("\n...js_SetPropertyDebug4 called on string \"%s\" object %u, jsval %lu\n",_id_c, (unsigned int) obj, *vp);
 	} else if (JSVAL_IS_INT(id)) {
 		num = JSVAL_TO_INT(id);
@@ -1301,7 +1301,7 @@
 
 	/* get the id field... */
 	if (JSVAL_IS_STRING(id)) { 
-		_id_c = JS_GetStringBytes(JSVAL_TO_STRING(id)); 
+		_id_c = JS_EncodeString(context, JSVAL_TO_STRING(id)); 
         	printf ("\n...js_SetPropertyDebug5 called on string \"%s\" object %u, jsval %lu\n",_id_c, (unsigned int) obj, *vp);
 	} else if (JSVAL_IS_INT(id)) {
 		num = JSVAL_TO_INT(id);
@@ -1319,7 +1319,7 @@
 
 	/* get the id field... */
 	if (JSVAL_IS_STRING(id)) { 
-		_id_c = JS_GetStringBytes(JSVAL_TO_STRING(id)); 
+		_id_c = JS_EncodeString(context, JSVAL_TO_STRING(id)); 
         	printf ("\n...js_SetPropertyDebug6 called on string \"%s\" object %u, jsval %lu\n",_id_c, (unsigned int) obj, *vp);
 	} else if (JSVAL_IS_INT(id)) {
 		num = JSVAL_TO_INT(id);
@@ -1337,7 +1337,7 @@
 
 	/* get the id field... */
 	if (JSVAL_IS_STRING(id)) { 
-		_id_c = JS_GetStringBytes(JSVAL_TO_STRING(id)); 
+		_id_c = JS_EncodeString(context, JSVAL_TO_STRING(id)); 
         	printf ("\n...js_SetPropertyDebug7 called on string \"%s\" object %u, jsval %lu\n",_id_c, (unsigned int) obj, *vp);
 	} else if (JSVAL_IS_INT(id)) {
 		num = JSVAL_TO_INT(id);
@@ -1355,7 +1355,7 @@
 
 	/* get the id field... */
 	if (JSVAL_IS_STRING(id)) { 
-		_id_c = JS_GetStringBytes(JSVAL_TO_STRING(id)); 
+		_id_c = JS_EncodeString(context, JSVAL_TO_STRING(id)); 
         	printf ("\n...js_SetPropertyDebug8 called on string \"%s\" object %u, jsval %lu\n",_id_c, (unsigned int) obj, *vp);
 	} else if (JSVAL_IS_INT(id)) {
 		num = JSVAL_TO_INT(id);
@@ -1373,7 +1373,7 @@
 
 	/* get the id field... */
 	if (JSVAL_IS_STRING(id)) { 
-		_id_c = JS_GetStringBytes(JSVAL_TO_STRING(id)); 
+		_id_c = JS_EncodeString(context, JSVAL_TO_STRING(id)); 
         	printf ("\n...js_SetPropertyDebug9 called on string \"%s\" object %u, jsval %lu\n",_id_c, (unsigned int) obj, *vp);
 	} else if (JSVAL_IS_INT(id)) {
 		num = JSVAL_TO_INT(id);
diff -wbBur freewrl-1.22.10/src/lib/world_script/jsVRMLBrowser.c freewrl-1.22.10.my/src/lib/world_script/jsVRMLBrowser.c
--- freewrl-1.22.10/src/lib/world_script/jsVRMLBrowser.c	2010-08-02 23:55:57.000000000 +0400
+++ freewrl-1.22.10.my/src/lib/world_script/jsVRMLBrowser.c	2011-07-04 20:06:25.000000000 +0400
@@ -336,7 +336,7 @@
 			return JS_FALSE;
 		}
 		_str = JS_ValueToString(context, argv[0]);
-		_costr = JS_GetStringBytes(_str);
+		_costr = JS_EncodeString(context, _str);
 
 		/* sanitize string, for the EAI_RW call (see EAI_RW code) */
 		tptr = _costr;
@@ -385,10 +385,10 @@
 			return JS_FALSE;
 		}
 		_str[0] = JS_ValueToString(context, argv[0]);
-		_costr[0] = JS_GetStringBytes(_str[0]);
+		_costr[0] = JS_EncodeString(context, _str[0]);
 
 		_str[1] = JS_ValueToString(context, argv[1]);
-		_costr[1] = JS_GetStringBytes(_str[1]);
+		_costr[1] = JS_EncodeString(context, _str[1]);
 
 		/* we use the EAI code for this - so reformat this for the EAI format */
 		{
@@ -575,7 +575,7 @@
 	/* third parameter should be a string */
 	if (JSVAL_IS_STRING(argv[2])) {
 		_str[1] = JSVAL_TO_STRING(argv[2]);
-		fieldStr = JS_GetStringBytes(_str[1]);
+		fieldStr = JS_EncodeString(context, _str[1]);
 		#ifdef JSVERBOSE
 		printf ("field string is :%s:\n",fieldStr); 
 		#endif
@@ -590,7 +590,7 @@
 
 	/* get the URL listing as a string */
 	_str[0] = JS_ValueToString(context, argv[0]);
-	_costr0 = JS_GetStringBytes(_str[0]);
+	_costr0 = JS_EncodeString(context, _str[0]);
 
 
 	#ifdef JSVERBOSE
@@ -690,7 +690,7 @@
 	for (count=0; count < argc; count++) {
 		if (JSVAL_IS_STRING(argv[count])) {
 			_str = JSVAL_TO_STRING(argv[count]);
-			_id_c = JS_GetStringBytes(_str);
+			_id_c = JS_EncodeString(context, _str);
 			#if defined(AQUA) || defined(_MSC_VER)
 			BrowserPrintConsoleMessage(_id_c); /* statusbar hud */
 			consMsgCount = 0; /* reset the "Maximum" count */
@@ -850,7 +850,7 @@
 
 	/* parameter should be a string */
 	if (JSVAL_IS_STRING(argv[0])) {
-		target = JS_GetStringBytes( JSVAL_TO_STRING(argv[0]));
+		target = JS_EncodeString(context,  JSVAL_TO_STRING(argv[0]));
 		#ifdef JSVERBOSE
 		printf ("field string is %s\n",target); 
 		#endif
@@ -930,7 +930,7 @@
 
 	/* parameters should be a string */
 	if (JSVAL_IS_STRING(argv[0])) {
-		targetDevice = JS_GetStringBytes( JSVAL_TO_STRING(argv[0]));
+		targetDevice = JS_EncodeString(cx,  JSVAL_TO_STRING(argv[0]));
 		#ifdef JSVERBOSE
 		printf ("field string is %s\n",targetDevice); 
 		#endif
@@ -939,7 +939,7 @@
 		return -1;
 	}
 	if (JSVAL_IS_STRING(argv[1])) {
-		targetController = JS_GetStringBytes( JSVAL_TO_STRING(argv[1]));
+		targetController = JS_EncodeString(cx,  JSVAL_TO_STRING(argv[1]));
 		#ifdef JSVERBOSE
 		printf ("field string is %s\n",targetController); 
 		#endif
diff -wbBur freewrl-1.22.10/src/lib/world_script/jsVRMLClasses.c freewrl-1.22.10.my/src/lib/world_script/jsVRMLClasses.c
--- freewrl-1.22.10/src/lib/world_script/jsVRMLClasses.c	2010-09-22 23:40:48.000000000 +0400
+++ freewrl-1.22.10.my/src/lib/world_script/jsVRMLClasses.c	2011-07-04 20:08:03.000000000 +0400
@@ -935,7 +935,7 @@
                 		        printf( "JS_NewDouble failed for %f in simplecopyelements.\n",dd);
                         		return JS_FALSE;
                 		}
-                		val = DOUBLE_TO_JSVAL(dp);
+                		val = DOUBLE_TO_JSVAL(*dp);
 
 			}
 		}
@@ -1108,7 +1108,7 @@
 
 		printf ("HAVE STRING HERE!\n");
 		_str = JS_ValueToString(cx, id);
-		asciiStr = JS_GetStringBytes(_str);
+		asciiStr = JS_EncodeString(context, _str);
 		printf ("we have as a parameter :%s:\n",asciiStr);
 		#endif
 
@@ -1185,7 +1185,7 @@
 			if (_tmpStr==NULL) {
 				_tmp_valStr = "NULL";
 			} else {
-				_tmp_valStr = JS_GetStringBytes(_tmpStr);
+				_tmp_valStr = JS_EncodeString(cx, _tmpStr);
 			}
 		}
 
@@ -1281,7 +1281,7 @@
 	#endif
 
 	str = JS_ValueToString(cx, id);
-	p = JS_GetStringBytes(str);
+	p = JS_EncodeString(cx, str);
 	#ifdef JSVRMLCLASSESVERBOSE
 		printf("\tid string  %s\n ",p);
 	#endif
@@ -1368,12 +1368,12 @@
 	char * _c;
 		printf ("doMFSetProperty, for object %u, vp %u\n", obj,*vp);
 		_str = JS_ValueToString(cx, id);
-		_c = JS_GetStringBytes(_str);
+		_c = JS_EncodeString(cx, _str);
 		printf ("id is %s\n",_c);
 
 		_sstr = JS_ValueToString(cx, *vp);
 		printf ("looking up value for %d %x object %p\n",*vp,*vp,obj);
-			_cc = JS_GetStringBytes(_sstr);
+			_cc = JS_EncodeString(cx, _sstr);
 			printf("\tdoMFSetProperty:%d: obj = %p, id = %s, vp = %s\n",type,
 			   obj, _c, _cc);
 		if (JSVAL_IS_OBJECT(*vp)) { printf ("doMFSet, vp is an OBJECT\n"); }
@@ -1397,7 +1397,7 @@
 
 			if (!JS_ValueToInt32(cx, *vp, &i)) {
 				_sstr = JS_ValueToString(cx, *vp);
-				_cc = JS_GetStringBytes(_sstr);
+				_cc = JS_EncodeString(cx, _sstr);
 				printf ("can not convert %s to an integer in doMFAddProperty for type %d\n",_cc,type);
 				return JS_FALSE;
 			}
@@ -1408,7 +1408,7 @@
 		#ifdef JSVRMLCLASSESVERBOSE
 		printf ("doMFSetProperty - ensure that this is a DOUBLE ");
 				_sstr = JS_ValueToString(cx, *vp);
-				_cc = JS_GetStringBytes(_sstr);
+				_cc = JS_EncodeString(cx, _sstr);
 				printf ("value is  %s \n",_cc);
 		#endif
 
@@ -1420,7 +1420,7 @@
                		        printf( "JS_NewDouble failed for %f in simplecopyelements.\n",dd);
                        		return JS_FALSE;
                		}
-               		*vp = DOUBLE_TO_JSVAL(dp);
+               		*vp = DOUBLE_TO_JSVAL(*dp);
 
 		}
 	}
@@ -1511,7 +1511,7 @@
 			nf = OBJECT_TO_JSVAL(me);
 
 			#ifdef JSVRMLCLASSESVERBOSE
-			printf ("parentField is %u \"%s\"\n", pf, JS_GetStringBytes(JSVAL_TO_STRING(pf)));
+			printf ("parentField is %u \"%s\"\n", pf, JS_EncodeString(cx, JSVAL_TO_STRING(pf)));
 			#endif
 
 			if (!setSFNodeField (cx, par, pf, &nf)) {
@@ -1535,7 +1535,7 @@
 	unsigned int i, j = 0;
 
 	_str = JS_ValueToString(cx, *vp);
-	_buff = JS_GetStringBytes(_str);
+	_buff = JS_EncodeString(cx, _str);
 	_buff_len = strlen(_buff) + 1;
 
 	#ifdef JSVRMLCLASSESVERBOSE
@@ -1719,14 +1719,14 @@
 	size_t len = 0;
 
 	_idStr = JS_ValueToString(context, id);
-	_id_c = JS_GetStringBytes(_idStr);
+	_id_c = JS_EncodeString(context, _idStr);
 
         /* "register" this ECMA value for routing changed flag stuff */
        	setInECMATable(context, _id_c);
 
 	if (JSVAL_IS_STRING(*vp)) {
 		_vpStr = JS_ValueToString(context, *vp);
-		_vp_c = JS_GetStringBytes(_vpStr);
+		_vp_c = JS_EncodeString(context, _vpStr);
 
 		len = strlen(_vp_c);
 
@@ -1752,7 +1752,7 @@
 	} else {
 		#ifdef JSVRMLCLASSESVERBOSE
 		_vpStr = JS_ValueToString(context, *vp);
-		_vp_c = JS_GetStringBytes(_vpStr);
+		_vp_c = JS_EncodeString(cx, _vpStr);
 		printf("setECMANative: obj = %p, id = \"%s\", vp = %s\n",
 			   obj, _id_c, _vp_c);
 		#endif
@@ -1770,9 +1770,9 @@
 	JSString *_idStr, *_vpStr;
 	char *_id_c, *_vp_c;
 		_idStr = JS_ValueToString(cx, id);
-		_id_c = JS_GetStringBytes(_idStr);
+		_id_c = JS_EncodeString(cx, _idStr);
 		_vpStr = JS_ValueToString(cx, *vp);
-		_vp_c = JS_GetStringBytes(_vpStr);
+		_vp_c = JS_EncodeString(cx, _vpStr);
 		printf("getAssignProperty: obj = %p, id = \"%s\", vp = %s\n",
 			   obj, _id_c, _vp_c);
 	printf ("what is vp? \n");
@@ -1803,7 +1803,7 @@
 
 	if (JSVAL_IS_STRING(id)) {
 		_str = JSVAL_TO_STRING(id);
-		_id_c = JS_GetStringBytes(_str);
+		_id_c = JS_EncodeString(cx, _str);
 		if (!JS_ConvertValue(cx, *vp, JSTYPE_OBJECT, &newVal)) {
 			printf( "JS_ConvertValue failed in setAssignProperty.\n");
 			return JS_FALSE;
@@ -1834,9 +1834,9 @@
                 if (JSVAL_IS_DOUBLE(id)) printf ("id is an DOUBLE\n");
                 if (JSVAL_IS_INT(id)) printf ("id is an INT\n");
 
-		printf ("id is %s\n",JS_GetStringBytes(JS_ValueToString(cx,id)));
-		printf ("initVal is %s\n",JS_GetStringBytes(JS_ValueToString(cx,initVal)));
-		printf ("newVal is %s\n",JS_GetStringBytes(JS_ValueToString(cx,newVal)));
+		printf ("id is %s\n",JS_EncodeString(cx, JS_ValueToString(cx,id)));
+		printf ("initVal is %s\n",JS_EncodeString(cx, JS_ValueToString(cx,initVal)));
+		printf ("newVal is %s\n",JS_EncodeString(cx, JS_ValueToString(cx,newVal)));
 
 		#endif
 
@@ -1859,7 +1859,7 @@
 	} else {
 		#ifdef JSVRMLCLASSESVERBOSE
 			_str = JS_ValueToString(cx, id);
-			_id_c = JS_GetStringBytes(_str);
+			_id_c = JS_EncodeString(cx, _str);
 			printf("setAssignProperty: obj = %p, id = \"%s\"\n",
 				   obj, _id_c);
 		#endif
diff -wbBur freewrl-1.22.10/src/lib/world_script/jsVRMLClasses.h freewrl-1.22.10.my/src/lib/world_script/jsVRMLClasses.h
--- freewrl-1.22.10/src/lib/world_script/jsVRMLClasses.h	2010-10-13 23:45:26.000000000 +0400
+++ freewrl-1.22.10.my/src/lib/world_script/jsVRMLClasses.h	2011-07-04 20:24:53.000000000 +0400
@@ -30,6 +30,21 @@
 #ifndef __FREEWRL_JS_VRML_CLASSES_H__
 #define __FREEWRL_JS_VRML_CLASSES_H__
 
+static inline jsval JS_NewJSVal(JSContext *cx, jsdouble d)
+{
+	jsval ret;
+	JS_NewNumberValue(cx, d, &ret);
+	return ret;
+}
+
+static inline jsdouble * JS_NewDouble(JSContext *cx, jsdouble d)
+{
+	static jsdouble ret;
+	jsval rv;
+	JS_NewNumberValue(cx, d, &rv);
+	ret = JSVAL_TO_DOUBLE(rv);
+	return &ret;
+}
 
 #ifndef UNUSED
 #define UNUSED(v) ((void) v)
@@ -80,14 +95,14 @@
 
 
 #define SET_JS_TICKTIME_FALSE(possibleRetVal) { jsval zimbo; \
-        zimbo = DOUBLE_TO_JSVAL(JS_NewDouble(cx, TickTime));  \
+        zimbo = JS_NewJSVal(cx, TickTime);  \
         if (!JS_DefineProperty(cx,obj, "__eventInTickTime", zimbo, JS_GET_PROPERTY_STUB, JS_SET_PROPERTY_STUB2, JSPROP_PERMANENT)) {  \
                 printf( "JS_DefineProperty failed for \"__eventInTickTime\" at %s:%d.\n",__FILE__,__LINE__); \
                 return possibleRetVal; \
         }}
 
 #define SET_JS_TICKTIME() { jsval zimbo; \
-        zimbo = DOUBLE_TO_JSVAL(JS_NewDouble(cx, TickTime));  \
+        zimbo = JS_NewJSVal(cx, TickTime);  \
         if (!JS_DefineProperty(cx,obj, "__eventInTickTime", zimbo, JS_GET_PROPERTY_STUB, JS_SET_PROPERTY_STUB2, JSPROP_PERMANENT)) {  \
                 printf( "JS_DefineProperty failed for \"__eventInTickTime\" at %s:%d.\n",__FILE__,__LINE__); \
                 return FALSE; \
diff -wbBur freewrl-1.22.10/src/lib/world_script/jsVRML_MFClasses.c freewrl-1.22.10.my/src/lib/world_script/jsVRML_MFClasses.c
--- freewrl-1.22.10/src/lib/world_script/jsVRML_MFClasses.c	2010-09-22 23:40:48.000000000 +0400
+++ freewrl-1.22.10.my/src/lib/world_script/jsVRML_MFClasses.c	2011-07-04 20:08:44.000000000 +0400
@@ -596,7 +596,7 @@
 			return;
 		}
 
-		val = DOUBLE_TO_JSVAL(dp);
+		val = DOUBLE_TO_JSVAL(*dp);
 
 		if (!JS_SetElement(cx, obj, (jsint) i, &val)) {
 			printf( "JS_DefineElement failed for arg %u in VrmlMatrixSetTransform.\n", i);
@@ -1212,7 +1212,7 @@
 /*
                 if (JSVAL_IS_STRING(id)==TRUE) {
                 printf("        is a common string :%s:\n",
-                        JS_GetStringBytes(JS_ValueToString(cx, id)));
+                        JS_EncodeString(cx, JS_ValueToString(cx, id)));
                 }
                 if (JSVAL_IS_OBJECT(id)==TRUE) {
                         printf ("       parameter is an object\n");
@@ -1231,7 +1231,7 @@
 		_index = JSVAL_TO_INT(id);
 
 		if (_index >= _length) {
-			*vp = DOUBLE_TO_JSVAL(&zerojsdouble);
+			*vp = DOUBLE_TO_JSVAL(zerojsdouble);
 			if (!JS_DefineElement(cx, obj, (jsint) _index, *vp, JS_GET_PROPERTY_STUB, JS_SET_PROPERTY_CHECK, JSPROP_ENUMERATE)) {
 				printf( "JS_DefineElement failed in VrmlMatrixGetProperty.\n");
 				return JS_FALSE;
@@ -1331,7 +1331,7 @@
 	printf("MFStringAddProperty: vp = %p\n", obj);
                 if (JSVAL_IS_STRING(*vp)==TRUE) {
 		printf("	is a common string :%s:\n",
-                        JS_GetStringBytes(JS_ValueToString(cx, *vp)));
+                        JS_EncodeString(cx, JS_ValueToString(cx, *vp)));
                 }
                 if (JSVAL_IS_OBJECT(*vp)==TRUE) {
                         printf ("       parameter is an object\n");
@@ -1345,7 +1345,7 @@
 		printf("MFStringAddProperty: id = %p\n", obj);
                 if (JSVAL_IS_STRING(id)==TRUE) {
 		printf("	is a common string :%s:\n",
-                        JS_GetStringBytes(JS_ValueToString(cx, id)));
+                        JS_EncodeString(cx, JS_ValueToString(cx, id)));
                 }
                 if (JSVAL_IS_OBJECT(id)==TRUE) {
                         printf ("       parameter is an object\n");
@@ -1494,7 +1494,7 @@
 		if (JSVAL_IS_STRING(argv[i])==TRUE) {
         	        printf (" Common String, is");
 			_str = JS_ValueToString(cx, argv[i]);
-			printf (JS_GetStringBytes(_str));
+			printf (JS_EncodeString(cx, _str));
 			printf ("..");
 		
 	        }                                          
diff -wbBur freewrl-1.22.10/src/lib/world_script/jsVRML_SFClasses.c freewrl-1.22.10.my/src/lib/world_script/jsVRML_SFClasses.c
--- freewrl-1.22.10/src/lib/world_script/jsVRML_SFClasses.c	2010-09-25 00:22:05.000000000 +0400
+++ freewrl-1.22.10.my/src/lib/world_script/jsVRML_SFClasses.c	2011-07-04 20:09:01.000000000 +0400
@@ -161,7 +161,7 @@
 			printf( "JS_NewDouble failed for %f in SFColorGetHSV.\n", xp[i]);
 			return JS_FALSE;
 		}
-		_v = DOUBLE_TO_JSVAL(dp);
+		_v = DOUBLE_TO_JSVAL(*dp);
         	JS_SetElement(cx, result, (jsint)i, &_v); 
         } 
 
@@ -336,7 +336,7 @@
 						d);
 				return JS_FALSE;
 			}
-			*vp = DOUBLE_TO_JSVAL(dp);
+			*vp = DOUBLE_TO_JSVAL(*dp);
 			break;
 		case 1:
 			d = (ptr->v).c[1];
@@ -346,7 +346,7 @@
 						d);
 				return JS_FALSE;
 			}
-			*vp = DOUBLE_TO_JSVAL(dp);
+			*vp = DOUBLE_TO_JSVAL(*dp);
 			break;
 		case 2:
 			d = (ptr->v).c[2];
@@ -356,7 +356,7 @@
 						d);
 				return JS_FALSE;
 			}
-			*vp = DOUBLE_TO_JSVAL(dp);
+			*vp = DOUBLE_TO_JSVAL(*dp);
 			break;
 		}
 	}
@@ -387,13 +387,13 @@
 	if (JSVAL_IS_INT(id)) {
 		switch (JSVAL_TO_INT(id)) {
 		case 0:
-			(ptr->v).c[0] = (float) *JSVAL_TO_DOUBLE(_val);
+			(ptr->v).c[0] = (float) JSVAL_TO_DOUBLE(_val);
 			break;
 		case 1:
-			(ptr->v).c[1] = (float) *JSVAL_TO_DOUBLE(_val);
+			(ptr->v).c[1] = (float) JSVAL_TO_DOUBLE(_val);
 			break;
 		case 2:
-			(ptr->v).c[2] = (float) *JSVAL_TO_DOUBLE(_val);
+			(ptr->v).c[2] = (float) JSVAL_TO_DOUBLE(_val);
 			break;
 
 		}
@@ -422,18 +422,18 @@
 	*rval = OBJECT_TO_JSVAL(_arrayObj);
 
 	/* construct new double before conversion? */
-	_v = DOUBLE_TO_JSVAL(&hue);
+	_v = DOUBLE_TO_JSVAL(hue);
 	if (!JS_SetElement(cx, _arrayObj, 0, &_v)) {
 		printf( "JS_SetElement failed for hue in SFColorRGBAGetHSV.\n");
 		return JS_FALSE;
 	}
-	_v = DOUBLE_TO_JSVAL(&saturation);
+	_v = DOUBLE_TO_JSVAL(saturation);
 	if (!JS_SetElement(cx, _arrayObj, 1, &_v)) {
 		printf( "JS_SetElement failed for saturation in SFColorRGBAGetHSV.\n");
 		return JS_FALSE;
 	}
 
-	_v = DOUBLE_TO_JSVAL(&value);
+	_v = DOUBLE_TO_JSVAL(value);
 	if (!JS_SetElement(cx, _arrayObj, 2, &_v)) {
 		printf( "JS_SetElement failed for value in SFColorRGBAGetHSV.\n");
 		return JS_FALSE;
@@ -601,7 +601,7 @@
 						d);
 				return JS_FALSE;
 			}
-			*vp = DOUBLE_TO_JSVAL(dp);
+			*vp = DOUBLE_TO_JSVAL(*dp);
 			break;
 		case 1:
 			d = (ptr->v).c[1];
@@ -611,7 +611,7 @@
 						d);
 				return JS_FALSE;
 			}
-			*vp = DOUBLE_TO_JSVAL(dp);
+			*vp = DOUBLE_TO_JSVAL(*dp);
 			break;
 		case 2:
 			d = (ptr->v).c[2];
@@ -621,7 +621,7 @@
 						d);
 				return JS_FALSE;
 			}
-			*vp = DOUBLE_TO_JSVAL(dp);
+			*vp = DOUBLE_TO_JSVAL(*dp);
 			break;
 		case 3:
 			d = (ptr->v).c[3];
@@ -631,7 +631,7 @@
 						d);
 				return JS_FALSE;
 			}
-			*vp = DOUBLE_TO_JSVAL(dp);
+			*vp = DOUBLE_TO_JSVAL(*dp);
 			break;
 		}
 	}
@@ -662,16 +662,16 @@
 	if (JSVAL_IS_INT(id)) {
 		switch (JSVAL_TO_INT(id)) {
 		case 0:
-			(ptr->v).c[0] = (float) *JSVAL_TO_DOUBLE(_val);
+			(ptr->v).c[0] = (float) JSVAL_TO_DOUBLE(_val);
 			break;
 		case 1:
-			(ptr->v).c[1] = (float) *JSVAL_TO_DOUBLE(_val);
+			(ptr->v).c[1] = (float) JSVAL_TO_DOUBLE(_val);
 			break;
 		case 2:
-			(ptr->v).c[2] = (float) *JSVAL_TO_DOUBLE(_val);
+			(ptr->v).c[2] = (float) JSVAL_TO_DOUBLE(_val);
 			break;
 		case 3:
-			(ptr->v).c[3] = (float) *JSVAL_TO_DOUBLE(_val);
+			(ptr->v).c[3] = (float) JSVAL_TO_DOUBLE(_val);
 			break;
 
 		}
@@ -983,7 +983,7 @@
 	} else if (argc == 1) {
 		/* is this a string, or a number indicating a node? */
 		myStr = JS_ValueToString(cx, argv[0]);
-		cString = JS_GetStringBytes(myStr);
+		cString = JS_EncodeString(cx, myStr);
 		#ifdef JSVRMLCLASSESVERBOSE
 		printf ("SFNodeConstr, argc =1l string %s\n",cString);
 		#endif
@@ -1067,13 +1067,13 @@
         		char *_id_c;
 
 			_idStr = JS_ValueToString(cx, argv[0]);
-			_id_c = JS_GetStringBytes(_idStr);
+			_id_c = JS_EncodeString(cx, _idStr);
 			/* printf ("first string :%s:\n",_id_c); */
 
 			cString = STRDUP(_id_c);
 
 			_idStr = JS_ValueToString(cx, argv[1]);
-			_id_c = JS_GetStringBytes(_idStr);
+			_id_c = JS_EncodeString(cx, _idStr);
 			/* printf ("second string :%s:\n",_id_c); */
 
 			if (sscanf (_id_c,"%p",&newHandle) != 1) {
@@ -1190,7 +1190,7 @@
 	jsval rval;
 
         _idStr = JS_ValueToString(cx, id);
-        _id_c = JS_GetStringBytes(_idStr);
+        _id_c = JS_EncodeString(cx, _idStr);
 
 	#ifdef JSVRMLCLASSESVERBOSE
 	printf ("start of SFNodeGetProperty... id is %s\n",_id_c);
@@ -1264,10 +1264,10 @@
 
 
 	_idStr = JS_ValueToString(cx, id);
-	_id_c = JS_GetStringBytes(_idStr);
+	_id_c = JS_EncodeString(cx, _idStr);
 
 	_valStr = JS_ValueToString(cx, *vp);
-	_val_c = JS_GetStringBytes(_valStr);
+	_val_c = JS_EncodeString(cx, _valStr);
 
 	#ifdef JSVRMLCLASSESVERBOSE
 		printf("SFNodeSetProperty: obj = %p, id = %s, vp = %s\n",
@@ -1904,7 +1904,7 @@
 						d);
 				return JS_FALSE;
 			}
-			*vp = DOUBLE_TO_JSVAL(dp);
+			*vp = DOUBLE_TO_JSVAL(*dp);
 			break;
 		case 1:
 			d = (ptr->v).c[1];
@@ -1914,7 +1914,7 @@
 						d);
 				return JS_FALSE;
 			}
-			*vp = DOUBLE_TO_JSVAL(dp);
+			*vp = DOUBLE_TO_JSVAL(*dp);
 			break;
 		case 2:
 			d = (ptr->v).c[2];
@@ -1924,7 +1924,7 @@
 						d);
 				return JS_FALSE;
 			}
-			*vp = DOUBLE_TO_JSVAL(dp);
+			*vp = DOUBLE_TO_JSVAL(*dp);
 			break;
 		case 3:
 			d = (ptr->v).c[3];
@@ -1934,7 +1934,7 @@
 						d);
 				return JS_FALSE;
 			}
-			*vp = DOUBLE_TO_JSVAL(dp);
+			*vp = DOUBLE_TO_JSVAL(*dp);
 			break;
 		}
 	}
@@ -1969,16 +1969,16 @@
 	if (JSVAL_IS_INT(id)) {
 		switch (JSVAL_TO_INT(id)) {
 		case 0:
-			(ptr->v).c[0] = (float) *JSVAL_TO_DOUBLE(myv);
+			(ptr->v).c[0] = (float) JSVAL_TO_DOUBLE(myv);
 			break;
 		case 1:
-			(ptr->v).c[1] = (float) *JSVAL_TO_DOUBLE(myv);
+			(ptr->v).c[1] = (float) JSVAL_TO_DOUBLE(myv);
 			break;
 		case 2:
-			(ptr->v).c[2] = (float) *JSVAL_TO_DOUBLE(myv);
+			(ptr->v).c[2] = (float) JSVAL_TO_DOUBLE(myv);
 			break;
 		case 3:
-			(ptr->v).c[3] = (float) *JSVAL_TO_DOUBLE(myv);
+			(ptr->v).c[3] = (float) JSVAL_TO_DOUBLE(myv);
 			break;
 		}
 	}
@@ -2051,7 +2051,7 @@
 			 * it get created in javascript? */
 			if (param_isString) {
 				_str = JS_ValueToString(cx, *argv);
-				charString = JS_GetStringBytes(_str);
+				charString = JS_EncodeString(cx, _str);
 
 				if (sscanf(charString, "%lf %lf",
 							&(pars[0]), &(pars[1])) != 2) {
@@ -2143,7 +2143,7 @@
 			printf( "JS_NewDouble failed for %f in SFVec2f.\n",d);
 			return JS_FALSE;
 		}
-		*rval = DOUBLE_TO_JSVAL(dp);
+		*rval = DOUBLE_TO_JSVAL(*dp);
 	}
 
 	#ifdef JSVRMLCLASSESVERBOSE
@@ -2332,7 +2332,7 @@
 						d);
 				return JS_FALSE;
 			}
-			*vp = DOUBLE_TO_JSVAL(dp);
+			*vp = DOUBLE_TO_JSVAL(*dp);
 			break;
 		case 1:
 			d = (ptr->v).c[1];
@@ -2342,7 +2342,7 @@
 						d);
 				return JS_FALSE;
 			}
-			*vp = DOUBLE_TO_JSVAL(dp);
+			*vp = DOUBLE_TO_JSVAL(*dp);
 			break;
 		}
 	}
@@ -2373,13 +2373,13 @@
 	if (JSVAL_IS_INT(id)) {
 		switch (JSVAL_TO_INT(id)) {
 		case 0:
-			(ptr->v).c[0] = (float) *JSVAL_TO_DOUBLE(myv);
+			(ptr->v).c[0] = (float) JSVAL_TO_DOUBLE(myv);
 			break;
 		case 1:
-			(ptr->v).c[1] = (float) *JSVAL_TO_DOUBLE(myv);
+			(ptr->v).c[1] = (float) JSVAL_TO_DOUBLE(myv);
 			break;
 		case 2:
-			(ptr->v).c[2] = (float) *JSVAL_TO_DOUBLE(myv);
+			(ptr->v).c[2] = (float) JSVAL_TO_DOUBLE(myv);
 			break;
 		}
 	}
@@ -2458,7 +2458,7 @@
 			 * it get created in javascript? */
 			if (param_isString) {
 				_str = JS_ValueToString(cx, *argv);
-				charString = JS_GetStringBytes(_str);
+				charString = JS_EncodeString(cx, _str);
 
 				if (sscanf(charString, "%lf %lf %lf",
 							&(pars[0]), &(pars[1]), &(pars[2])) != 3) {
@@ -2580,7 +2580,7 @@
 			printf( "JS_NewDouble failed for %f in SFVec3f.\n",d);
 			return JS_FALSE;
 		}
-		*rval = DOUBLE_TO_JSVAL(dp);
+		*rval = DOUBLE_TO_JSVAL(*dp);
 	}
 	#ifdef JSVRMLCLASSESVERBOSE
 	if (retSFVec3f){
@@ -2792,9 +2792,9 @@
 	char *_id_c;
 
 	_idStr = JS_ValueToString(cx, id);
-	_id_c = JS_GetStringBytes(_idStr);
+	_id_c = JS_EncodeString(cx, _idStr);
 	_idStr = JS_ValueToString(cx, *vp);
-	_id_c = JS_GetStringBytes(_idStr);
+	_id_c = JS_EncodeString(cx, _idStr);
 
 	#endif
 
@@ -2813,7 +2813,7 @@
 						d);
 				return JS_FALSE;
 			}
-			*vp = DOUBLE_TO_JSVAL(dp);
+			*vp = DOUBLE_TO_JSVAL(*dp);
 			break;
 		case 1:
 			d = (ptr->v).c[1];
@@ -2823,7 +2823,7 @@
 						d);
 				return JS_FALSE;
 			}
-			*vp = DOUBLE_TO_JSVAL(dp);
+			*vp = DOUBLE_TO_JSVAL(*dp);
 			break;
 		case 2:
 			d = (ptr->v).c[2];
@@ -2833,7 +2833,7 @@
 						d);
 				return JS_FALSE;
 			}
-			*vp = DOUBLE_TO_JSVAL(dp);
+			*vp = DOUBLE_TO_JSVAL(*dp);
 			break;
 		}
 	} else {
@@ -2869,13 +2869,13 @@
 	if (JSVAL_IS_INT(id)) {
 		switch (JSVAL_TO_INT(id)) {
 		case 0:
-			(ptr->v).c[0] = (float) *JSVAL_TO_DOUBLE(myv);
+			(ptr->v).c[0] = (float) JSVAL_TO_DOUBLE(myv);
 			break;
 		case 1:
-			(ptr->v).c[1] = (float) *JSVAL_TO_DOUBLE(myv);
+			(ptr->v).c[1] = (float) JSVAL_TO_DOUBLE(myv);
 			break;
 		case 2:
-			(ptr->v).c[2] = (float) *JSVAL_TO_DOUBLE(myv);
+			(ptr->v).c[2] = (float) JSVAL_TO_DOUBLE(myv);
 			break;
 		}
 	}
@@ -2949,7 +2949,7 @@
 			 * it get created in javascript? */
 			if (param_isString) {
 				_str = JS_ValueToString(cx, *argv);
-				charString = JS_GetStringBytes(_str);
+				charString = JS_EncodeString(cx, _str);
 
 				if (sscanf(charString, "%lf %lf %lf",
 							&(pars[0]), &(pars[1]), &(pars[2])) != 3) {
@@ -3071,7 +3071,7 @@
 			printf( "JS_NewDouble failed for %f in SFVec3d.\n",d);
 			return JS_FALSE;
 		}
-		*rval = DOUBLE_TO_JSVAL(dp);
+		*rval = DOUBLE_TO_JSVAL(*dp);
 	}
 	#ifdef JSVRMLCLASSESVERBOSE
 	if (retSFVec3d){
@@ -3282,9 +3282,9 @@
 	char *_id_c;
 
 	_idStr = JS_ValueToString(cx, id);
-	_id_c = JS_GetStringBytes(_idStr);
+	_id_c = JS_EncodeString(cx, _idStr);
 	_idStr = JS_ValueToString(cx, *vp);
-	_id_c = JS_GetStringBytes(_idStr);
+	_id_c = JS_EncodeString(cx, _idStr);
 
 	#endif
 
@@ -3303,7 +3303,7 @@
 						d);
 				return JS_FALSE;
 			}
-			*vp = DOUBLE_TO_JSVAL(dp);
+			*vp = DOUBLE_TO_JSVAL(*dp);
 			break;
 		case 1:
 			d = (ptr->v).c[1];
@@ -3313,7 +3313,7 @@
 						d);
 				return JS_FALSE;
 			}
-			*vp = DOUBLE_TO_JSVAL(dp);
+			*vp = DOUBLE_TO_JSVAL(*dp);
 			break;
 		case 2:
 			d = (ptr->v).c[2];
@@ -3323,7 +3323,7 @@
 						d);
 				return JS_FALSE;
 			}
-			*vp = DOUBLE_TO_JSVAL(dp);
+			*vp = DOUBLE_TO_JSVAL(*dp);
 			break;
 		}
 	} else {
@@ -3359,13 +3359,13 @@
 	if (JSVAL_IS_INT(id)) {
 		switch (JSVAL_TO_INT(id)) {
 		case 0:
-			(ptr->v).c[0] = *JSVAL_TO_DOUBLE(myv);
+			(ptr->v).c[0] = JSVAL_TO_DOUBLE(myv);
 			break;
 		case 1:
-			(ptr->v).c[1] = *JSVAL_TO_DOUBLE(myv);
+			(ptr->v).c[1] = JSVAL_TO_DOUBLE(myv);
 			break;
 		case 2:
-			(ptr->v).c[2] = *JSVAL_TO_DOUBLE(myv);
+			(ptr->v).c[2] = JSVAL_TO_DOUBLE(myv);
 			break;
 		}
 	}
@@ -3513,9 +3513,9 @@
 	char *_id_c;
 
 	_idStr = JS_ValueToString(cx, id);
-	_id_c = JS_GetStringBytes(_idStr);
+	_id_c = JS_EncodeString(cx, _idStr);
 	_idStr = JS_ValueToString(cx, *vp);
-	_id_c = JS_GetStringBytes(_idStr);
+	_id_c = JS_EncodeString(cx, _idStr);
 
 	#endif
 
@@ -3534,7 +3534,7 @@
 						d);
 				return JS_FALSE;
 			}
-			*vp = DOUBLE_TO_JSVAL(dp);
+			*vp = DOUBLE_TO_JSVAL(*dp);
 			break;
 		case 1:
 			d = (ptr->v).c[1];
@@ -3544,7 +3544,7 @@
 						d);
 				return JS_FALSE;
 			}
-			*vp = DOUBLE_TO_JSVAL(dp);
+			*vp = DOUBLE_TO_JSVAL(*dp);
 			break;
 		case 2:
 			d = (ptr->v).c[2];
@@ -3554,7 +3554,7 @@
 						d);
 				return JS_FALSE;
 			}
-			*vp = DOUBLE_TO_JSVAL(dp);
+			*vp = DOUBLE_TO_JSVAL(*dp);
 			break;
 		case 3:
 			d = (ptr->v).c[3];
@@ -3564,7 +3564,7 @@
 						d);
 				return JS_FALSE;
 			}
-			*vp = DOUBLE_TO_JSVAL(dp);
+			*vp = DOUBLE_TO_JSVAL(*dp);
 			break;
 		}
 	} else {
@@ -3600,16 +3600,16 @@
 	if (JSVAL_IS_INT(id)) {
 		switch (JSVAL_TO_INT(id)) {
 		case 0:
-			(ptr->v).c[0] = (float) *JSVAL_TO_DOUBLE(myv);
+			(ptr->v).c[0] = (float) JSVAL_TO_DOUBLE(myv);
 			break;
 		case 1:
-			(ptr->v).c[1] = (float) *JSVAL_TO_DOUBLE(myv);
+			(ptr->v).c[1] = (float) JSVAL_TO_DOUBLE(myv);
 			break;
 		case 2:
-			(ptr->v).c[2] = (float) *JSVAL_TO_DOUBLE(myv);
+			(ptr->v).c[2] = (float) JSVAL_TO_DOUBLE(myv);
 			break;
 		case 3:
-			(ptr->v).c[3] = (float) *JSVAL_TO_DOUBLE(myv);
+			(ptr->v).c[3] = (float) JSVAL_TO_DOUBLE(myv);
 			break;
 		}
 	}
@@ -3758,9 +3758,9 @@
 	char *_id_c;
 
 	_idStr = JS_ValueToString(cx, id);
-	_id_c = JS_GetStringBytes(_idStr);
+	_id_c = JS_EncodeString(cx, _idStr);
 	_idStr = JS_ValueToString(cx, *vp);
-	_id_c = JS_GetStringBytes(_idStr);
+	_id_c = JS_EncodeString(cx, _idStr);
 
 	#endif
 
@@ -3779,7 +3779,7 @@
 						d);
 				return JS_FALSE;
 			}
-			*vp = DOUBLE_TO_JSVAL(dp);
+			*vp = DOUBLE_TO_JSVAL(*dp);
 			break;
 		case 1:
 			d = (ptr->v).c[1];
@@ -3789,7 +3789,7 @@
 						d);
 				return JS_FALSE;
 			}
-			*vp = DOUBLE_TO_JSVAL(dp);
+			*vp = DOUBLE_TO_JSVAL(*dp);
 			break;
 		case 2:
 			d = (ptr->v).c[2];
@@ -3799,7 +3799,7 @@
 						d);
 				return JS_FALSE;
 			}
-			*vp = DOUBLE_TO_JSVAL(dp);
+			*vp = DOUBLE_TO_JSVAL(*dp);
 			break;
 		case 3:
 			d = (ptr->v).c[3];
@@ -3809,7 +3809,7 @@
 						d);
 				return JS_FALSE;
 			}
-			*vp = DOUBLE_TO_JSVAL(dp);
+			*vp = DOUBLE_TO_JSVAL(*dp);
 			break;
 		}
 	} else {
@@ -3845,16 +3845,16 @@
 	if (JSVAL_IS_INT(id)) {
 		switch (JSVAL_TO_INT(id)) {
 		case 0:
-			(ptr->v).c[0] = (float) *JSVAL_TO_DOUBLE(myv);
+			(ptr->v).c[0] = (float) JSVAL_TO_DOUBLE(myv);
 			break;
 		case 1:
-			(ptr->v).c[1] = (float) *JSVAL_TO_DOUBLE(myv);
+			(ptr->v).c[1] = (float) JSVAL_TO_DOUBLE(myv);
 			break;
 		case 2:
-			(ptr->v).c[2] = (float) *JSVAL_TO_DOUBLE(myv);
+			(ptr->v).c[2] = (float) JSVAL_TO_DOUBLE(myv);
 			break;
 		case 3:
-			(ptr->v).c[3] = (float) *JSVAL_TO_DOUBLE(myv);
+			(ptr->v).c[3] = (float) JSVAL_TO_DOUBLE(myv);
 			break;
 		}
 	}
diff -wbBur freewrl-1.22.10/src/lib/x3d_parser/X3DParser.c freewrl-1.22.10.my/src/lib/x3d_parser/X3DParser.c
--- freewrl-1.22.10/src/lib/x3d_parser/X3DParser.c	2010-09-22 20:54:59.000000000 +0400
+++ freewrl-1.22.10.my/src/lib/x3d_parser/X3DParser.c	2011-07-04 01:19:07.000000000 +0400
@@ -54,7 +54,7 @@
 #include "X3DProtoScript.h"
 
 #if HAVE_EXPAT_H
-# include <expat.h>
+# include </usr/include/expat.h>
 #endif
 //#define X3DPARSERVERBOSE 1