]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - client/reveng/poly.c
Allow externalisation of PrintAndLog (#506)
[proxmark3-svn] / client / reveng / poly.c
index 1e22b8d27d7a014611a86de4844ccca751ab0bf5..e4a8e8f950f307c2c4a52f2d38cdcccac68b9da3 100644 (file)
@@ -139,7 +139,7 @@ filtop(FILE *input, unsigned long length, int flags, int bperhx) {
        bmp_t accu = BMP_C(0);
        bmp_t mask = bperhx == BMP_BIT ? ~BMP_C(0) : (BMP_C(1) << bperhx) - BMP_C(1);
        unsigned long iter = 0UL, idx;
-       int cmask = ~(~0 << CHAR_BIT), c;
+       int cmask = ~(~0U << CHAR_BIT), c;
        int count = 0, ofs;
        poly_t poly = PZERO;
        if(bperhx == 0) return(poly);
@@ -204,7 +204,7 @@ strtop(const char *string, int flags, int bperhx) {
        bmp_t accu;
        bmp_t mask = bperhx == BMP_BIT ? ~BMP_C(0) : (BMP_C(1) << bperhx) - BMP_C(1);
        int pass, count, ofs;
-       int cmask = ~(~0 << CHAR_BIT), c;
+       int cmask = ~(~0U << CHAR_BIT), c;
        const char *s;
 
        poly_t poly = PZERO;
@@ -786,15 +786,16 @@ prev(poly_t *poly) {
        unsigned long fulllength = poly->length + ofs;
        bmp_t accu;
 
-       if(ofs)
+       if(ofs) {
                /* removable optimisation */
                if(poly->length < (unsigned long) BMP_BIT) {
                        *poly->bitmap = rev(*poly->bitmap >> ofs, (int) poly->length) << ofs;
                        return;
                }
+       }
 
-               /* claim remaining bits of last word (as we use public function pshift()) */
-               poly->length = fulllength;
+       /* claim remaining bits of last word (as we use public function pshift()) */
+       poly->length = fulllength;
 
        /* reverse and swap words in the array, leaving it right-justified */
        while(leftidx < rightidx) {
Impressum, Datenschutz