문제

I've used the .NET Reflector 8 by redgate and I used the feature that exports the .dll to C# files and I am running into one error situation that I do not know how to fix this error.

The error states: Error 36 Operator '<' cannot be applied to operands of type 'long' and 'ulong'

I understand the error has to do with the bitwise, but I'm not sure how to fix the specific situation.

if (!flag && (num7 < (((ulong) endLocation) - (((ulong) 4L) + num6))))
         {
           this.offsetOfFirstEntry = endLocation - ((4L + ((long) num6)) + num7);
              if (this.offsetOfFirstEntry <= 0L)
                    {
                        throw new ZipException("Invalid embedded zip archive");
                    }
}

Here is a snapshot of the error:

enter image description here

What is the best way to fix this type of error?

도움이 되었습니까?

해결책

How about casting num7 to a ulong?

if (!flag && ((ulong)num7 < (((ulong) endLocation) - (((ulong) 4L) + num6))))

This has nothing to do with bitwise operators, by the way.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top