Print this page
patch fix-lint


 260 
 261                 inp = dis_get_overlay(dhp, tp, idx);
 262 
 263                 if ((inp->in_type == INST_NONE) ||
 264                     ((inp->in_arch & dhp->dh_flags) == 0))
 265                         goto error;
 266 
 267                 if (inp->in_type == INST_TBL) {
 268                         tp = inp->in_data.in_tbl;
 269                         continue;
 270                 }
 271 
 272                 break;
 273         }
 274 
 275         if (tp->tbl_fmt(dhp, instr, inp, idx) == 0)
 276                 return (0);
 277 
 278 error:
 279 
 280         (void) snprintf(buf, buflen,
 281             ((dhp->dh_flags & DIS_OCTAL) != 0) ? "0%011lo" : "0x%08lx",
 282             instr);
 283 
 284         return (0);
 285 }
 286 
 287 static uint32_t
 288 dis_get_bits(uint32_t instr, int offset, int length)
 289 {
 290         uint32_t mask, val;
 291         int i;
 292 
 293         for (i = 0, mask = 0; i < length; ++i)
 294                 mask |= (1UL << i);
 295 
 296         mask = mask << (offset - length + 1);
 297 
 298         val = instr & mask;
 299 
 300         val = val >> (offset - length + 1);




 260 
 261                 inp = dis_get_overlay(dhp, tp, idx);
 262 
 263                 if ((inp->in_type == INST_NONE) ||
 264                     ((inp->in_arch & dhp->dh_flags) == 0))
 265                         goto error;
 266 
 267                 if (inp->in_type == INST_TBL) {
 268                         tp = inp->in_data.in_tbl;
 269                         continue;
 270                 }
 271 
 272                 break;
 273         }
 274 
 275         if (tp->tbl_fmt(dhp, instr, inp, idx) == 0)
 276                 return (0);
 277 
 278 error:
 279 
 280         (void) dis_snprintf(buf, buflen,
 281             ((dhp->dh_flags & DIS_OCTAL) != 0) ? "0%011lo" : "0x%08lx",
 282             instr);
 283 
 284         return (0);
 285 }
 286 
 287 static uint32_t
 288 dis_get_bits(uint32_t instr, int offset, int length)
 289 {
 290         uint32_t mask, val;
 291         int i;
 292 
 293         for (i = 0, mask = 0; i < length; ++i)
 294                 mask |= (1UL << i);
 295 
 296         mask = mask << (offset - length + 1);
 297 
 298         val = instr & mask;
 299 
 300         val = val >> (offset - length + 1);