On 12.07.22 21:32, Juan José Santamaría Flecha wrote:
Please find attached a rebased version. I have split the patch into two parts trying to make it easier to review, one with the code changes and the other with the test.

Other than that, there are minimal changes from the previous version to the code due to the update of _WIN32_WINNT and enabling the test on cirrus.

I'm not familiar with Windows, so I'm just looking at the overall structure of this patch. I think it pretty much makes sense. But we need to consider that this operates on the confluence of various different operating system interfaces that not all people will be familiar with, so we need to really get the documentation done well.

Consider this function you are introducing:

+/*
+ * Create a collation if the input locale is valid for so.
+ * Also keeps track of the number of valid locales and collations created.
+ */
+static int
+CollationFromLocale(char *isolocale, char *localebuf, int *nvalid,
+                                       int *ncreated, int nspid)

This declaration is incomprehensible without studying all the callers and the surrounding code.

Start with the name: What does "collation from locale" mean? Does it make a collation? Does it convert one? Does it find one? There should be a verb in there.

(I think in the context of this file, a lower case name would be more appropriate for a static function.)

Then the arguments. The input arguments should be "const". All the arguments should be documented. What is "isolocale", what is "localebuf", how are they different? What is being counted by "valid" (collatons?, locales?), and what makes a thing valid and invalid? What is being "created"? What is nspid? What is the return value?

Please make another pass over this.

Also consider describing in the commit message what you are doing in more detail, including some of the things that have been discussed in this thread.



Reply via email to