예제 #1
0
파일: fattab.c 프로젝트: TijmenW/FreeDOS
CLUSTER link_fat(struct dpb FAR * dpbp, CLUSTER Cluster1,
                 REG CLUSTER Cluster2)
{
  struct buffer FAR *bp;
  unsigned idx;
  unsigned secdiv;
  unsigned char wasfree = 0;
  CLUSTER clussec = Cluster1;
  CLUSTER max_cluster = dpbp->dpb_size;

#ifdef WITHFAT32
  if (ISFAT32(dpbp))
    max_cluster = dpbp->dpb_xsize;
#endif
 
  if (clussec <= 1 || clussec > max_cluster)
  {
    put_string("run CHKDSK: trying to access invalid cluster 0x");
#ifdef WITHFAT32
    put_unsigned((unsigned)(clussec >> 16), 16, 4);
#endif
    put_unsigned((unsigned)(clussec & 0xffffu), 16, 4);
    put_console('\n');
    return 1;
  }
예제 #2
0
파일: print_ll.c 프로젝트: k6s/tek1
static int	put_unsigned(unsigned long long var, unsigned int base_len)
{
  int		ret;

  ret = 0;
  if (var >= base_len)
    ret = put_unsigned(var / base_len, base_len);
  my_putchar(var % base_len + '0');
  return (ret + 1);
}
예제 #3
0
파일: print_ll.c 프로젝트: k6s/tek1
int		put_ll_reg(t_types *var, char conv, int base_len)
{
  if (conv == 'i' || conv == 'd')
    {
      var->lls = (signed long long)var->lls;
      return (put_signed(var->lls, base_len));
    }
  else if (conv == 'u' || conv == 'o')
    return (put_unsigned((unsigned long long)var->lls, base_len));
  return (-1);
}