int jffs2_dynrubin_compress(unsigned char *data_in, unsigned char *cpage_out, uint32_t *sourcelen, uint32_t *dstlen, void *model) 
static int jffs2_dynrubin_compress(unsigned char *data_in, unsigned char *cpage_out, uint32_t *sourcelen, uint32_t *dstlen, void *model) 
int jffs2_dynrubin_compress(unsigned char *data_in, unsigned char *cpage_out, 		   uint32_t *sourcelen, uint32_t *dstlen, void *model){	int bits[8];	unsigned char histo[256];	int i;	int ret;	uint32_t mysrclen, mydstlen;	mysrclen = *sourcelen;	mydstlen = *dstlen - 8;	if (*dstlen <= 12)		return -1;	memset(histo, 0, 256);	for (i=0; i<mysrclen; i++) {		histo[data_in[i]]++;	}	memset(bits, 0, sizeof(int)*8);	for (i=0; i<256; i++) {		if (i&128)			bits[7] += histo[i];		if (i&64)			bits[6] += histo[i];		if (i&32)			bits[5] += histo[i];		if (i&16)			bits[4] += histo[i];		if (i&8)			bits[3] += histo[i];		if (i&4)			bits[2] += histo[i];		if (i&2)			bits[1] += histo[i];		if (i&1)			bits[0] += histo[i];	}	for (i=0; i<8; i++) {		bits[i] = (bits[i] * 256) / mysrclen;		if (!bits[i]) bits[i] = 1;		if (bits[i] > 255) bits[i] = 255;		cpage_out[i] = bits[i];	}	ret = rubin_do_compress(256, bits, data_in, cpage_out+8, &mysrclen, &mydstlen);	if (ret) 		return ret;	/* Add back the 8 bytes we took for the probabilities */	mydstlen += 8;	if (mysrclen <= mydstlen) {		/* We compressed */		return -1;	}	*sourcelen = mysrclen;	*dstlen = mydstlen;	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/75c96f85845a6707b0f9916cb263cb3584f7d48f/compr_rubin.c/buggy/fs/jffs2/compr_rubin.c