forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit8bdb36a
committed
Clean up some questionable usages of DatumGet* macros
This tidies up some questionable coding which made use ofDatumGetPointer() for Datums being passed into functions where theparameter is expected to be a cstring. We saw no compiler warnings withthe old code as the Pointer type used in DatumGetPointer() happens tobe a char * rather than a void *. However, that's no excuse and we shouldbe using the correct macro for the job.Here we also make use of OutputFunctionCall() rather than usingFunctionCall1() directly to call the type's output function.OutputFunctionCall() is the standard way to do this. It casts thereturned value to a cstring for us.In passing get rid of a duplicate call to strlen(). Most compilers willlikely optimize away the 2nd call, but there may be some that won't. Inany case, this just aligns the code to some other nearby code that alreadydoes this.Discussion:https://postgr.es/m/CAApHDvq1D=ehZ8hey8Hz67N+_Zth0GHO5wiVCfv1YcGPMXJq0A@mail.gmail.com1 parente453938 commit8bdb36a
1 file changed
+14
-14
lines changedLines changed: 14 additions & 14 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
634 | 634 |
| |
635 | 635 |
| |
636 | 636 |
| |
637 |
| - | |
| 637 | + | |
638 | 638 |
| |
639 | 639 |
| |
640 | 640 |
| |
| |||
695 | 695 |
| |
696 | 696 |
| |
697 | 697 |
| |
698 |
| - | |
| 698 | + | |
699 | 699 |
| |
700 |
| - | |
| 700 | + | |
701 | 701 |
| |
702 | 702 |
| |
703 | 703 |
| |
| |||
780 | 780 |
| |
781 | 781 |
| |
782 | 782 |
| |
783 |
| - | |
784 |
| - | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
785 | 787 |
| |
786 | 788 |
| |
787 | 789 |
| |
| |||
830 | 832 |
| |
831 | 833 |
| |
832 | 834 |
| |
833 |
| - | |
| 835 | + | |
834 | 836 |
| |
835 | 837 |
| |
836 | 838 |
| |
| |||
3032 | 3034 |
| |
3033 | 3035 |
| |
3034 | 3036 |
| |
3035 |
| - | |
3036 |
| - | |
| 3037 | + | |
| 3038 | + | |
3037 | 3039 |
| |
3038 | 3040 |
| |
3039 | 3041 |
| |
3040 | 3042 |
| |
3041 | 3043 |
| |
3042 |
| - | |
3043 |
| - | |
| 3044 | + | |
| 3045 | + | |
3044 | 3046 |
| |
3045 |
| - | |
3046 |
| - | |
3047 |
| - | |
| 3047 | + | |
3048 | 3048 |
| |
3049 | 3049 |
| |
3050 | 3050 |
| |
| |||
3084 | 3084 |
| |
3085 | 3085 |
| |
3086 | 3086 |
| |
3087 |
| - | |
| 3087 | + | |
3088 | 3088 |
| |
3089 | 3089 |
| |
3090 | 3090 |
| |
|
0 commit comments
Comments
(0)