亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? crc32.c

?? 一款最完整的工業組態軟源代碼
?? C
字號:
/* crc32.c -- compute the CRC-32 of a data stream
 * Copyright (C) 1995-2003 Mark Adler
 * For conditions of distribution and use, see copyright notice in zlib.h
 *
 * Thanks to Rodney Brown <rbrown64@csc.com.au> for his contribution of faster
 * CRC methods: exclusive-oring 32 bits of data at a time, and pre-computing
 * tables for updating the shift register in one step with three exclusive-ors
 * instead of four steps with four exclusive-ors.  This results about a factor
 * of two increase in speed on a Power PC G4 (PPC7455) using gcc -O3.
 */

/* @(#) $Id: crc32.c,v 1.3 2004/06/27 11:43:04 drolon Exp $ */

#ifdef MAKECRCH
#  include <stdio.h>
#  ifndef DYNAMIC_CRC_TABLE
#    define DYNAMIC_CRC_TABLE
#  endif /* !DYNAMIC_CRC_TABLE */
#endif /* MAKECRCH */

#include "zutil.h"      /* for STDC and FAR definitions */

#define local static

/* Find a four-byte integer type for crc32_little() and crc32_big(). */
#ifndef NOBYFOUR
#  ifdef STDC           /* need ANSI C limits.h to determine sizes */
#    include <limits.h>
#    define BYFOUR
#    if (UINT_MAX == 0xffffffffUL)
       typedef unsigned int u4;
#    else
#      if (ULONG_MAX == 0xffffffffUL)
         typedef unsigned long u4;
#      else
#        if (USHRT_MAX == 0xffffffffUL)
           typedef unsigned short u4;
#        else
#          undef BYFOUR     /* can't find a four-byte integer type! */
#        endif
#      endif
#    endif
#  endif /* STDC */
#endif /* !NOBYFOUR */

/* Definitions for doing the crc four data bytes at a time. */
#ifdef BYFOUR
#  define REV(w) (((w)>>24)+(((w)>>8)&0xff00)+ \
                (((w)&0xff00)<<8)+(((w)&0xff)<<24))
   local unsigned long crc32_little OF((unsigned long,
                        const unsigned char FAR *, unsigned));
   local unsigned long crc32_big OF((unsigned long,
                        const unsigned char FAR *, unsigned));
#  define TBLS 8
#else
#  define TBLS 1
#endif /* BYFOUR */

#ifdef DYNAMIC_CRC_TABLE

local int crc_table_empty = 1;
local unsigned long FAR crc_table[TBLS][256];
local void make_crc_table OF((void));
#ifdef MAKECRCH
   local void write_table OF((FILE *, const unsigned long FAR *));
#endif /* MAKECRCH */

/*
  Generate tables for a byte-wise 32-bit CRC calculation on the polynomial:
  x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1.

  Polynomials over GF(2) are represented in binary, one bit per coefficient,
  with the lowest powers in the most significant bit.  Then adding polynomials
  is just exclusive-or, and multiplying a polynomial by x is a right shift by
  one.  If we call the above polynomial p, and represent a byte as the
  polynomial q, also with the lowest power in the most significant bit (so the
  byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p,
  where a mod b means the remainder after dividing a by b.

  This calculation is done using the shift-register method of multiplying and
  taking the remainder.  The register is initialized to zero, and for each
  incoming bit, x^32 is added mod p to the register if the bit is a one (where
  x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by
  x (which is shifting right by one and adding x^32 mod p if the bit shifted
  out is a one).  We start with the highest power (least significant bit) of
  q and repeat for all eight bits of q.

  The first table is simply the CRC of all possible eight bit values.  This is
  all the information needed to generate CRCs on data a byte at a time for all
  combinations of CRC register values and incoming bytes.  The remaining tables
  allow for word-at-a-time CRC calculation for both big-endian and little-
  endian machines, where a word is four bytes.
*/
local void make_crc_table()
{
    unsigned long c;
    int n, k;
    unsigned long poly;            /* polynomial exclusive-or pattern */
    /* terms of polynomial defining this crc (except x^32): */
    static const unsigned char p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26};

    /* make exclusive-or pattern from polynomial (0xedb88320UL) */
    poly = 0UL;
    for (n = 0; n < sizeof(p)/sizeof(unsigned char); n++)
        poly |= 1UL << (31 - p[n]);

    /* generate a crc for every 8-bit value */
    for (n = 0; n < 256; n++) {
        c = (unsigned long)n;
        for (k = 0; k < 8; k++)
            c = c & 1 ? poly ^ (c >> 1) : c >> 1;
        crc_table[0][n] = c;
    }

#ifdef BYFOUR
    /* generate crc for each value followed by one, two, and three zeros, and
       then the byte reversal of those as well as the first table */
    for (n = 0; n < 256; n++) {
        c = crc_table[0][n];
        crc_table[4][n] = REV(c);
        for (k = 1; k < 4; k++) {
            c = crc_table[0][c & 0xff] ^ (c >> 8);
            crc_table[k][n] = c;
            crc_table[k + 4][n] = REV(c);
        }
    }
#endif /* BYFOUR */

  crc_table_empty = 0;

#ifdef MAKECRCH
    /* write out CRC tables to crc32.h */
    {
        FILE *out;

        out = fopen("crc32.h", "w");
        if (out == NULL) return;
        fprintf(out, "/* crc32.h -- tables for rapid CRC calculation\n");
        fprintf(out, " * Generated automatically by crc32.c\n */\n\n");
        fprintf(out, "local const unsigned long FAR ");
        fprintf(out, "crc_table[TBLS][256] =\n{\n  {\n");
        write_table(out, crc_table[0]);
#  ifdef BYFOUR
        fprintf(out, "#ifdef BYFOUR\n");
        for (k = 1; k < 8; k++) {
            fprintf(out, "  },\n  {\n");
            write_table(out, crc_table[k]);
        }
        fprintf(out, "#endif\n");
#  endif /* BYFOUR */
        fprintf(out, "  }\n};\n");
        fclose(out);
    }
#endif /* MAKECRCH */
}

#ifdef MAKECRCH
local void write_table(out, table)
    FILE *out;
    const unsigned long FAR *table;
{
    int n;

    for (n = 0; n < 256; n++)
        fprintf(out, "%s0x%08lxUL%s", n % 5 ? "" : "    ", table[n],
                n == 255 ? "\n" : (n % 5 == 4 ? ",\n" : ", "));
}
#endif /* MAKECRCH */

#else /* !DYNAMIC_CRC_TABLE */
/* ========================================================================
 * Tables of CRC-32s of all single-byte values, made by make_crc_table().
 */
#include "crc32.h"
#endif /* DYNAMIC_CRC_TABLE */

/* =========================================================================
 * This function can be used by asm versions of crc32()
 */
const unsigned long FAR * ZEXPORT get_crc_table()
{
#ifdef DYNAMIC_CRC_TABLE
  if (crc_table_empty) make_crc_table();
#endif /* DYNAMIC_CRC_TABLE */
  return (const unsigned long FAR *)crc_table;
}

/* ========================================================================= */
#define DO1 crc = crc_table[0][((int)crc ^ (*buf++)) & 0xff] ^ (crc >> 8)
#define DO8 DO1; DO1; DO1; DO1; DO1; DO1; DO1; DO1

/* ========================================================================= */
unsigned long ZEXPORT crc32(crc, buf, len)
    unsigned long crc;
    const unsigned char FAR *buf;
    unsigned len;
{
    if (buf == Z_NULL) return 0UL;

#ifdef DYNAMIC_CRC_TABLE
    if (crc_table_empty)
        make_crc_table();
#endif /* DYNAMIC_CRC_TABLE */

#ifdef BYFOUR
    if (sizeof(void *) == sizeof(ptrdiff_t)) {
        u4 endian;

        endian = 1;
        if (*((unsigned char *)(&endian)))
            return crc32_little(crc, buf, len);
        else
            return crc32_big(crc, buf, len);
    }
#endif /* BYFOUR */
    crc = crc ^ 0xffffffffUL;
    while (len >= 8) {
        DO8;
        len -= 8;
    }
    if (len) do {
        DO1;
    } while (--len);
    return crc ^ 0xffffffffUL;
}

#ifdef BYFOUR

/* ========================================================================= */
#define DOLIT4 c ^= *buf4++; \
        c = crc_table[3][c & 0xff] ^ crc_table[2][(c >> 8) & 0xff] ^ \
            crc_table[1][(c >> 16) & 0xff] ^ crc_table[0][c >> 24]
#define DOLIT32 DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4

/* ========================================================================= */
local unsigned long crc32_little(crc, buf, len)
    unsigned long crc;
    const unsigned char FAR *buf;
    unsigned len;
{
    register u4 c;
    register const u4 FAR *buf4;

    c = (u4)crc;
    c = ~c;
    while (len && ((ptrdiff_t)buf & 3)) {
        c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8);
        len--;
    }

    buf4 = (const u4 FAR *)buf;
    while (len >= 32) {
        DOLIT32;
        len -= 32;
    }
    while (len >= 4) {
        DOLIT4;
        len -= 4;
    }
    buf = (const unsigned char FAR *)buf4;

    if (len) do {
        c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8);
    } while (--len);
    c = ~c;
    return (unsigned long)c;
}

/* ========================================================================= */
#define DOBIG4 c ^= *++buf4; \
        c = crc_table[4][c & 0xff] ^ crc_table[5][(c >> 8) & 0xff] ^ \
            crc_table[6][(c >> 16) & 0xff] ^ crc_table[7][c >> 24]
#define DOBIG32 DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4

/* ========================================================================= */
local unsigned long crc32_big(crc, buf, len)
    unsigned long crc;
    const unsigned char FAR *buf;
    unsigned len;
{
    register u4 c;
    register const u4 FAR *buf4;

    c = REV((u4)crc);
    c = ~c;
    while (len && ((ptrdiff_t)buf & 3)) {
        c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8);
        len--;
    }

    buf4 = (const u4 FAR *)buf;
    buf4--;
    while (len >= 32) {
        DOBIG32;
        len -= 32;
    }
    while (len >= 4) {
        DOBIG4;
        len -= 4;
    }
    buf4++;
    buf = (const unsigned char FAR *)buf4;

    if (len) do {
        c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8);
    } while (--len);
    c = ~c;
    return (unsigned long)(REV(c));
}

#endif /* BYFOUR */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧洲中文日韩久久av乱码| 国产成人在线色| 色乱码一区二区三区88| 中文字幕一区二区三区蜜月| 国产精品中文字幕一区二区三区| 久久综合久久综合亚洲| 国产乱码一区二区三区| 久久亚洲精品小早川怜子| 国产在线视频精品一区| 久久久久久久综合色一本| 国产高清视频一区| 亚洲色图在线播放| 欧美网站大全在线观看| 一区二区三区高清不卡| 欧美丰满少妇xxxbbb| 美腿丝袜亚洲一区| 国产日韩精品久久久| 91亚洲资源网| 日日摸夜夜添夜夜添精品视频 | 亚洲品质自拍视频网站| 欧美性猛交xxxx乱大交退制版| 亚洲大片精品永久免费| 精品成人一区二区三区四区| 成人综合日日夜夜| 亚洲一区在线观看视频| 337p粉嫩大胆色噜噜噜噜亚洲| 国产超碰在线一区| 亚洲男人天堂一区| 精品少妇一区二区| 不卡在线视频中文字幕| 亚洲www啪成人一区二区麻豆| 久久综合久久99| 91网站在线观看视频| 日韩成人伦理电影在线观看| 欧美国产日韩亚洲一区| 欧美少妇xxx| 国产精品77777竹菊影视小说| 亚洲乱码国产乱码精品精98午夜 | 欧洲一区在线电影| 另类的小说在线视频另类成人小视频在线 | 成人av在线资源网站| 亚洲国产一区二区三区| 久久久久久久久久久久久夜| 欧美日韩卡一卡二| 成人深夜在线观看| 免费人成精品欧美精品| 亚洲女厕所小便bbb| 精品99999| 在线播放欧美女士性生活| youjizz国产精品| 久久狠狠亚洲综合| 一个色在线综合| 国产精品人成在线观看免费| 欧美日韩国产小视频| 成人丝袜视频网| 激情综合五月天| 日韩av网站在线观看| 一二三四区精品视频| 亚洲欧洲精品一区二区三区| xf在线a精品一区二区视频网站| 欧美日韩专区在线| 色综合夜色一区| 成人性生交大片免费看视频在线 | a4yy欧美一区二区三区| 国产乱码精品一区二区三区av| 日韩成人午夜电影| 视频一区视频二区中文| 尤物av一区二区| 一区在线观看免费| 国产精品久久久久影院| 久久久另类综合| www亚洲一区| 久久影院午夜论| 精品国产一区a| 日韩精品一区二区三区在线观看| 制服丝袜成人动漫| 欧美另类一区二区三区| 欧美日韩在线精品一区二区三区激情 | 久久亚洲精品国产精品紫薇| 欧美v日韩v国产v| 日韩美女一区二区三区四区| 欧美xxxxxxxx| 国产无人区一区二区三区| 久久久精品免费观看| 久久久久久9999| 国产视频不卡一区| 国产精品婷婷午夜在线观看| 国产日韩欧美精品电影三级在线| 中文在线一区二区| 国产精品麻豆99久久久久久| 亚洲人成在线播放网站岛国| 国产精品久久久久四虎| 国产精品第五页| 亚洲丝袜精品丝袜在线| 一区二区不卡在线播放| 日韩精品91亚洲二区在线观看| 午夜免费久久看| 美脚の诱脚舐め脚责91 | 亚洲成人资源在线| 日本欧美在线看| 国产真实乱子伦精品视频| 国产成人在线影院| 一本大道av伊人久久综合| 欧美性色黄大片| 日韩网站在线看片你懂的| 久久综合久久久久88| 亚洲欧美日韩在线播放| 丝袜亚洲另类欧美综合| 久久精品国内一区二区三区| 国产成人99久久亚洲综合精品| 99久精品国产| 欧美一区二区免费视频| 精品国产精品网麻豆系列| 欧美国产精品劲爆| 亚洲国产欧美在线人成| 久久爱另类一区二区小说| 成人免费高清视频在线观看| 欧美影院一区二区三区| 欧美一二区视频| 国产欧美精品区一区二区三区| 亚洲成人动漫精品| 久久免费看少妇高潮| 国产精品久久久久久久久图文区 | 精品少妇一区二区三区日产乱码 | 中文字幕五月欧美| 日韩不卡一二三区| 成人99免费视频| 91精品中文字幕一区二区三区| 久久久久久黄色| 香蕉av福利精品导航| 国产电影精品久久禁18| 欧美日韩一区久久| 国产精品久久久久婷婷二区次| 天天爽夜夜爽夜夜爽精品视频| 国产精品一区二区三区99| 91麻豆国产在线观看| 欧美精品一区二区三区很污很色的 | 日韩av一区二区三区| 99精品国产视频| 久久亚洲春色中文字幕久久久| 亚洲国产你懂的| 成人av网在线| 337p日本欧洲亚洲大胆精品| 亚洲成人动漫在线观看| 91麻豆福利精品推荐| 久久一区二区视频| 日本sm残虐另类| 欧美日韩大陆在线| 国产精品乱人伦中文| 九九精品一区二区| 欧美精品少妇一区二区三区| 亚洲精品精品亚洲| 国产91精品久久久久久久网曝门 | 国精产品一区一区三区mba视频| 91在线国产福利| 国产精品无人区| 国产一区二区0| 欧美一区二区久久| 婷婷成人综合网| 欧美日韩在线精品一区二区三区激情| 国产精品久99| 国产成人午夜片在线观看高清观看| 日韩色视频在线观看| 天使萌一区二区三区免费观看| 欧美色窝79yyyycom| 亚洲综合成人在线视频| 91麻豆国产香蕉久久精品| 自拍av一区二区三区| 不卡的看片网站| 国产精品福利一区| 成人免费精品视频| 亚洲三级在线看| av不卡一区二区三区| 日韩美女久久久| 91免费观看在线| 亚洲综合色网站| 欧美日韩一级视频| 无码av中文一区二区三区桃花岛| 欧美在线视频全部完| 五月天一区二区| 欧美一级一区二区| 久久国产精品无码网站| 久久蜜桃香蕉精品一区二区三区| 国产精品小仙女| 国产精品婷婷午夜在线观看| 一本高清dvd不卡在线观看| 亚洲综合精品久久| 久久久久久免费网| 国产福利91精品一区二区三区| 久久久精品中文字幕麻豆发布| 国产成人综合在线观看| 亚洲视频精选在线| 欧美午夜寂寞影院| 一区二区三区高清在线| 欧美无人高清视频在线观看| 理论电影国产精品| 国产精品成人午夜| 欧美色图12p| 国产一区二区三区高清播放| 国产精品久久国产精麻豆99网站|