Changeset 98123a in git
- Timestamp:
- Sep 12, 2016, 6:48:06 PM (7 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a657104b677b4c461d018cbf3204d72d34ad66a9')
- Children:
- 6de4f47c2595122ae8162280a8ac90eefcfce27c
- Parents:
- da4b3223efff0b797045aad67f6bce7fe3596550
- Location:
- Singular
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/extra.cc
rda4b32 r98123a 3805 3805 else 3806 3806 #endif 3807 /*==================== sort =================*/ 3808 if(strcmp(sys_cmd,"sort")==0) 3809 { 3810 extern BOOLEAN jjSORTLIST(leftv,leftv); 3811 if (h->Typ()==LIST_CMD) 3812 return jjSORTLIST(res,h); 3813 else 3814 return TRUE; 3815 } 3816 else 3807 3817 /*==================== Error =================*/ 3808 3818 Werror( "(extended) system(\"%s\",...) %s", sys_cmd, feNotImplemented ); -
Singular/iparith.cc
rda4b32 r98123a 8204 8204 //Print("test %s\n",Tok2Cmdname(dA1[i].arg)); 8205 8205 if ((dA1[i].valid_for & NO_CONVERSION)==0) 8206 8206 { 8207 8207 if ((ai=iiTestConvert(at,dA1[i].arg,dConvertTypes))!=0) 8208 8208 { … … 8387 8387 { 8388 8388 if ((dA3[i].valid_for & NO_CONVERSION)==0) 8389 8389 { 8390 8390 if ((ai=iiTestConvert(at,dA3[i].arg1,dConvertTypes))!=0) 8391 8391 { … … 9152 9152 tmp.Copy(v); 9153 9153 bo=iiExprArith2TabIntern(&res_l->m[i],&c->m[i],CHINREM_CMD,&tmp,TRUE,dArith2+tab_pos,c->m[i].rtyp,tmp.rtyp,dConvertTypes); 9154 9154 tmp.CleanUp(); 9155 9155 if (bo) { Werror("chinrem failed for list entry %d",i+1); break;} 9156 9156 } … … 9313 9313 return bo; 9314 9314 } 9315 // -------------------------------------------------------------------- 9316 static int jjCOMPARE_ALL(const void * aa, const void * bb) 9317 { 9318 leftv a=(leftv)aa; 9319 int at=a->Typ(); 9320 leftv b=(leftv)bb; 9321 int bt=b->Typ();; 9322 if (at < bt) return -1; 9323 if (at > bt) return 1; 9324 int tab_pos=iiTabIndex(dArithTab2,JJTAB2LEN,'<'); 9325 sleftv tmp; 9326 memset(&tmp,0,sizeof(sleftv)); 9327 iiOp='<'; 9328 BOOLEAN bo=iiExprArith2TabIntern(&tmp,a,'<',b,FALSE,dArith2+tab_pos,at,bt,dConvertTypes); 9329 if (bo) 9330 { 9331 Werror(" no `<` for %s",Tok2Cmdname(at)); 9332 return -1; 9333 } 9334 else if (tmp.data==NULL) /* not < */ 9335 { 9336 iiOp=EQUAL_EQUAL; 9337 tab_pos=iiTabIndex(dArithTab2,JJTAB2LEN,EQUAL_EQUAL); 9338 bo=iiExprArith2TabIntern(&tmp,a,EQUAL_EQUAL,b,FALSE,dArith2+tab_pos,at,bt,dConvertTypes); 9339 if (bo) 9340 { 9341 Werror(" no `==` for %s",Tok2Cmdname(at)); 9342 return -1; 9343 } 9344 else if (tmp.data==NULL) /* not <,== */ return 1; 9345 else return 0; 9346 } 9347 else return -1; 9348 } 9349 BOOLEAN jjSORTLIST(leftv, leftv arg) 9350 { 9351 lists l=(lists)arg->Data(); 9352 if (l->nr>0) 9353 { 9354 qsort(l->m,l->nr+1,sizeof(sleftv),jjCOMPARE_ALL); 9355 } 9356 return FALSE; 9357 }
Note: See TracChangeset
for help on using the changeset viewer.