+/*-----------------------------------------------------------------
+ * int pCodeOpCompare(pCodeOp *pcops, pCodeOp *pcopd)
+ *
+ * Compare two pCodeOp's and return 1 if they're the same
+ *-----------------------------------------------------------------*/
+int pCodeOpCompare(pCodeOp *pcops, pCodeOp *pcopd)
+{
+ char b[50], *n2;
+
+ if(!pcops || !pcopd)
+ return 0;
+/*
+ fprintf(stderr," Comparing operands %s",
+ get_op( pcops,NULL,0));
+
+ fprintf(stderr," to %s\n",
+ get_op( pcopd,NULL,0));
+*/
+
+ if(pcops->type != pcopd->type) {
+ //fprintf(stderr," - fail - diff types\n");
+ return 0; // different types
+ }
+
+ if(pcops->type == PO_LITERAL) {
+
+ if((PCOL(pcops)->lit >= 0) && (PCOL(pcops)->lit == PCOL(pcopd)->lit))
+ return 1;
+
+ return 0;
+ }
+
+ b[0]=0;
+ get_op(pcops,b,50);
+
+ n2 = get_op(pcopd,NULL,0);
+
+ if( !n2 || strcmp(b,n2)) {
+ //fprintf(stderr," - fail - diff names: %s, len=%d, %s, len=%d\n",b,strlen(b), n2, strlen(n2) );
+ return 0; // different names
+ }
+
+ switch(pcops->type) {
+ case PO_DIR:
+ if( PCOR(pcops)->instance != PCOR(pcopd)->instance) {
+ //fprintf(stderr, " - fail different instances\n");
+ return 0;
+ }
+ break;
+ default:
+ break;
+ }
+
+ //fprintf(stderr," - pass\n");
+
+ return 1;
+}
+