(oldValue, newValue unsafe.Pointer, dataType DataType)
| 449 | } |
| 450 | |
| 451 | func AdditionUpdate(oldValue, newValue unsafe.Pointer, dataType DataType) { |
| 452 | switch dataType { |
| 453 | case Int8: |
| 454 | *(*int8)(oldValue) = *(*int8)(oldValue) + *(*int8)(newValue) |
| 455 | case Uint8: |
| 456 | *(*uint8)(oldValue) = *(*uint8)(oldValue) + *(*uint8)(newValue) |
| 457 | case Int16: |
| 458 | *(*int16)(oldValue) = *(*int16)(oldValue) + *(*int16)(newValue) |
| 459 | case Uint16: |
| 460 | *(*uint16)(oldValue) = *(*uint16)(oldValue) + *(*uint16)(newValue) |
| 461 | case Int32: |
| 462 | *(*int32)(oldValue) = *(*int32)(oldValue) + *(*int32)(newValue) |
| 463 | case Uint32: |
| 464 | *(*uint32)(oldValue) = *(*uint32)(oldValue) + *(*uint32)(newValue) |
| 465 | case Int64: |
| 466 | *(*int64)(oldValue) = *(*int64)(oldValue) + *(*int64)(newValue) |
| 467 | case Float32: |
| 468 | *(*float32)(oldValue) = *(*float32)(oldValue) + *(*float32)(newValue) |
| 469 | } |
| 470 | } |
| 471 | |
| 472 | // MinMaxUpdate update the old value if compareRes == expectedRes |
| 473 | func MinMaxUpdate(oldValue, newValue unsafe.Pointer, dataType DataType, cmpFunc CompareFunc, expectedRes int) { |
no outgoing calls
no test coverage detected