Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #include "core/fpdfapi/page/pageint.h" | 7 #include "core/fpdfapi/page/pageint.h" |
| 8 | 8 |
| 9 #include <limits.h> | 9 #include <limits.h> |
| 10 | 10 |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 336 i2 = (int)Pop(); | 336 i2 = (int)Pop(); |
| 337 Push(i1 ^ i2); | 337 Push(i1 ^ i2); |
| 338 break; | 338 break; |
| 339 case PSOP_NOT: | 339 case PSOP_NOT: |
| 340 i1 = (int)Pop(); | 340 i1 = (int)Pop(); |
| 341 Push((int)!i1); | 341 Push((int)!i1); |
| 342 break; | 342 break; |
| 343 case PSOP_BITSHIFT: { | 343 case PSOP_BITSHIFT: { |
| 344 int shift = (int)Pop(); | 344 int shift = (int)Pop(); |
| 345 int i = (int)Pop(); | 345 int i = (int)Pop(); |
| 346 if (shift > 0) { | 346 if (shift == 0) { |
| 347 Push(i << shift); | 347 Push(i); |
| 348 } else { | 348 break; |
| 349 Push(i >> -shift); | |
| 350 } | 349 } |
| 350 if (shift < -31 || shift > 31) { | |
| 351 Push(0); | |
| 352 break; | |
| 353 } | |
| 354 uint64_t unsigned_i = i; | |
|
Tom Sepez
2016/10/20 20:55:29
think we want to do it as a signed64?
| |
| 355 if (shift > 0) | |
| 356 unsigned_i <<= shift; | |
| 357 else | |
| 358 unsigned_i >>= shift; | |
|
Tom Sepez
2016/10/20 20:55:30
need a -shift here?
| |
| 359 Push(static_cast<int>(unsigned_i & 0xFFFFFFFF)); | |
| 351 break; | 360 break; |
| 352 } | 361 } |
| 353 case PSOP_TRUE: | 362 case PSOP_TRUE: |
| 354 Push(1); | 363 Push(1); |
| 355 break; | 364 break; |
| 356 case PSOP_FALSE: | 365 case PSOP_FALSE: |
| 357 Push(0); | 366 Push(0); |
| 358 break; | 367 break; |
| 359 case PSOP_POP: | 368 case PSOP_POP: |
| 360 Pop(); | 369 Pop(); |
| (...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 852 return m_Type == Type::kType2ExpotentialInterpolation | 861 return m_Type == Type::kType2ExpotentialInterpolation |
| 853 ? static_cast<const CPDF_ExpIntFunc*>(this) | 862 ? static_cast<const CPDF_ExpIntFunc*>(this) |
| 854 : nullptr; | 863 : nullptr; |
| 855 } | 864 } |
| 856 | 865 |
| 857 const CPDF_StitchFunc* CPDF_Function::ToStitchFunc() const { | 866 const CPDF_StitchFunc* CPDF_Function::ToStitchFunc() const { |
| 858 return m_Type == Type::kType3Stitching | 867 return m_Type == Type::kType3Stitching |
| 859 ? static_cast<const CPDF_StitchFunc*>(this) | 868 ? static_cast<const CPDF_StitchFunc*>(this) |
| 860 : nullptr; | 869 : nullptr; |
| 861 } | 870 } |
| OLD | NEW |