亚洲欧美第一页_禁久久精品乱码_粉嫩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$ */

#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一区二区三区免费野_久草精品视频
国产清纯白嫩初高生在线观看91| 欧美性感一区二区三区| 久久久久久久久久久久久久久99 | 美女免费视频一区二区| 欧美高清视频一二三区| 日韩精品一卡二卡三卡四卡无卡| 91高清在线观看| 午夜免费久久看| 欧美一级理论片| 91亚洲男人天堂| 亚洲免费在线播放| 欧美一三区三区四区免费在线看 | 日韩一区二区三区在线| 久久国产生活片100| 欧美国产精品v| 一本大道久久a久久综合婷婷| 天堂影院一区二区| 精品少妇一区二区三区日产乱码| 国产成人一区在线| 亚洲免费毛片网站| 日韩一区国产二区欧美三区| 国产电影一区在线| 亚洲一区中文日韩| 精品国产成人在线影院 | 国产激情一区二区三区四区 | 91亚洲大成网污www| 亚洲 欧美综合在线网络| 2021久久国产精品不只是精品| 成人久久视频在线观看| 偷拍日韩校园综合在线| 国产婷婷一区二区| 欧美日韩一卡二卡三卡| 天堂影院一区二区| 国产精品久久久一本精品 | 91蜜桃传媒精品久久久一区二区| 日韩国产成人精品| 亚洲人成7777| 久久无码av三级| 欧美三级日韩三级国产三级| 国产超碰在线一区| 午夜激情一区二区三区| 国产精品国产a| 精品国产不卡一区二区三区| 欧美色倩网站大全免费| 99精品国产91久久久久久 | 风间由美一区二区三区在线观看| 亚洲午夜精品17c| 国产精品欧美经典| 精品国产乱码久久久久久1区2区| 欧美日韩五月天| 99国产一区二区三精品乱码| 国产精品一区在线观看乱码 | 亚洲精品国产高清久久伦理二区| 精品国一区二区三区| 欧美日韩国产综合一区二区 | 一本到不卡精品视频在线观看| 国产一区欧美二区| 日av在线不卡| 亚洲国产精品天堂| 亚洲少妇中出一区| 国产精品短视频| 国产精品视频一二| 日韩精品一区二区三区中文不卡 | 日本视频免费一区| 亚洲国产乱码最新视频| 一区二区三区欧美激情| 18欧美亚洲精品| 国产精品亲子伦对白| 国产日韩欧美精品综合| 国产日韩视频一区二区三区| 精品剧情在线观看| 欧美一区二区三区喷汁尤物| 欧美日韩免费视频| 欧美日韩亚洲综合一区| 欧美色大人视频| 欧美无砖专区一中文字| 欧美日韩一区成人| 欧美日韩亚洲综合在线| 3d动漫精品啪啪1区2区免费| 欧美日韩一区二区三区四区| 欧美精品久久99久久在免费线 | 一区二区三区波多野结衣在线观看 | 色综合天天综合狠狠| 99精品久久99久久久久| 91婷婷韩国欧美一区二区| 99re8在线精品视频免费播放| 91啪九色porn原创视频在线观看| 99国产精品视频免费观看| 色婷婷av一区二区三区大白胸 | 国产人妖乱国产精品人妖| 国产日韩精品一区二区浪潮av | 一本一本大道香蕉久在线精品| 91论坛在线播放| 欧美色倩网站大全免费| 日韩欧美一级二级三级久久久| 欧美v国产在线一区二区三区| 久久精品亚洲麻豆av一区二区 | 日韩亚洲欧美一区| 欧美va亚洲va国产综合| 久久精品日产第一区二区三区高清版 | 午夜成人免费电影| 韩国成人在线视频| 成人91在线观看| 欧美在线不卡视频| 精品久久久久久最新网址| 久久久精品天堂| 亚洲免费大片在线观看| 日精品一区二区三区| 国产真实精品久久二三区| 99久久精品一区| 欧美精品九九99久久| 久久精品无码一区二区三区| 一级女性全黄久久生活片免费| 日本免费新一区视频| 成人av小说网| 日韩丝袜情趣美女图片| 国产精品久久久久永久免费观看 | 在线成人小视频| 久久精品水蜜桃av综合天堂| 一区二区在线观看免费视频播放| 蜜臀av性久久久久蜜臀aⅴ流畅| 国产成人啪免费观看软件| 欧美在线小视频| 久久美女艺术照精彩视频福利播放 | 精品视频在线免费观看| 国产亚洲一区二区在线观看| 亚洲一区电影777| 国产高清视频一区| 欧美日韩高清一区二区| 中文字幕欧美日韩一区| 天天av天天翘天天综合网 | 日韩av在线播放中文字幕| jvid福利写真一区二区三区| 欧美一区二区三区在线视频| 亚洲免费观看高清| 国产精品99久久久| 欧美一区二区三区精品| 亚洲欧美一区二区三区久本道91| 狠狠色丁香婷婷综合久久片| 欧美日韩dvd在线观看| 国产精品久久毛片a| 国产一区日韩二区欧美三区| 日韩一区二区视频在线观看| 亚洲一区中文日韩| 色哟哟国产精品免费观看| 欧美韩日一区二区三区四区| 久久97超碰国产精品超碰| 91精品啪在线观看国产60岁| 亚洲精品亚洲人成人网| av欧美精品.com| 亚洲国产高清不卡| 国产精品一品二品| 久久久久久久久久美女| 久久精品国产在热久久| 欧美一区二区三区男人的天堂 | 久久国产精品免费| 91麻豆精品国产91久久久久久| 亚洲乱码日产精品bd| 91亚洲精品一区二区乱码| 国产精品久久久久久久久免费樱桃| 国产激情视频一区二区在线观看 | 国产精品视频你懂的| 国产成人精品aa毛片| 精品1区2区在线观看| 久久99蜜桃精品| 欧美精品一区二区三区四区| 精品一区二区三区影院在线午夜 | 欧美女孩性生活视频| 亚洲va韩国va欧美va| 欧美性一级生活| 亚洲电影第三页| 91精品欧美一区二区三区综合在| 香蕉av福利精品导航 | 精品免费日韩av| 狠狠狠色丁香婷婷综合激情| 日韩一区二区中文字幕| 国产做a爰片久久毛片| 国产午夜精品一区二区三区四区| 国产精品一二二区| 亚洲欧美综合网| 在线一区二区三区四区| 午夜欧美在线一二页| 欧美一区二视频| 国产精品一区在线观看你懂的| 中国av一区二区三区| 一本久久精品一区二区| 亚洲一区在线视频| 欧美α欧美αv大片| 国产a级毛片一区| 日韩毛片视频在线看| 欧美日韩在线精品一区二区三区激情| 亚洲成人免费视频| 日韩午夜精品电影| 成人国产精品视频| 亚洲第一成年网| 久久―日本道色综合久久| 97aⅴ精品视频一二三区| 午夜精品福利视频网站| 国产日韩欧美在线一区| 欧美性猛交xxxxxxxx|