You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/07/28 17:21:16 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 opened a new pull request #4247: Redirect _l function to non-locale version

xiaoxiang781216 opened a new pull request #4247:
URL: https://github.com/apache/incubator-nuttx/pull/4247


   ## Summary
   Since locale can't be really changed in NuttX, the locale version is same as non-locale version.
   
   - locale: Add LC_GLOBAL_LOCALE which is specified by the standard
   - libc: Implement local_t related functions
   
   ## Impact
   New API
   
   ## Testing
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #4247: Redirect _l function to non-locale version

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #4247:
URL: https://github.com/apache/incubator-nuttx/pull/4247#discussion_r679609795



##########
File path: include/wchar.h
##########
@@ -34,6 +34,7 @@
 
 #include <stdio.h>
 #include <stddef.h>
+#include <local.h>

Review comment:
       Done, thanks.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] gustavonihei commented on a change in pull request #4247: Redirect _l function to non-locale version

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #4247:
URL: https://github.com/apache/incubator-nuttx/pull/4247#discussion_r679421110



##########
File path: libs/libc/string/lib_strncasecmp.c
##########
@@ -50,4 +50,9 @@ int strncasecmp(const char *cs, const char *ct, size_t nb)
 
   return result;
 }
+
+int strncasecmp_l(const char *cs, const char *ct, size_t nb, locale_t l)
+{
+  return strncasecmp(cs, ct, l);

Review comment:
       ```suggestion
     return strncasecmp(cs, ct, nb);
   ```
   Wrong parameter passed. CI build is failing due to this error.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] gustavonihei commented on a change in pull request #4247: Redirect _l function to non-locale version

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #4247:
URL: https://github.com/apache/incubator-nuttx/pull/4247#discussion_r679335435



##########
File path: libs/libc/wchar/lib_wcsftime.c
##########
@@ -39,4 +39,10 @@ size_t wcsftime(FAR wchar_t *s, size_t maxsize, FAR const wchar_t *format,
 
   return strftime((FAR char *)s, maxsize, (FAR char *)format, tim_p);
 }
+
+size_t wcsftime_l(FAR wchar_t *s, size_t maxsize, FAR const wchar_t *format,
+                 FAR const struct tm *tim_p, locale_t l)

Review comment:
       ```suggestion
                     FAR const struct tm *tim_p, locale_t l)
   ```
   nit: alignment




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] gustavonihei commented on a change in pull request #4247: Redirect _l function to non-locale version

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #4247:
URL: https://github.com/apache/incubator-nuttx/pull/4247#discussion_r679434252



##########
File path: libs/libc/string/lib_strncasecmp.c
##########
@@ -50,4 +50,9 @@ int strncasecmp(const char *cs, const char *ct, size_t nb)
 
   return result;
 }
+
+int strncasecmp_l(FAR const char *cs, FAR const char *ct, size_t nb, locale_t l)

Review comment:
       @xiaoxiang781216 Now we have an nxstyle error :rofl: 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #4247: Redirect _l function to non-locale version

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #4247:
URL: https://github.com/apache/incubator-nuttx/pull/4247#discussion_r679441495



##########
File path: libs/libc/string/lib_strncasecmp.c
##########
@@ -50,4 +50,9 @@ int strncasecmp(const char *cs, const char *ct, size_t nb)
 
   return result;
 }
+
+int strncasecmp_l(const char *cs, const char *ct, size_t nb, locale_t l)
+{
+  return strncasecmp(cs, ct, l);

Review comment:
       Done.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] gustavonihei commented on a change in pull request #4247: Redirect _l function to non-locale version

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #4247:
URL: https://github.com/apache/incubator-nuttx/pull/4247#discussion_r679335015



##########
File path: libs/libc/string/lib_strcoll.c
##########
@@ -56,4 +56,9 @@ int strcoll(const char *a, const char *b)
 {
   return strcmp(a, b);
 }
+
+int strcoll_l(const char *a, const char *b, locale_t l)

Review comment:
       ```suggestion
   int strcoll_l(FAR const char *a, FAR const char *b, locale_t l)
   ```
   Missing `FAR` qualifier.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] gustavonihei merged pull request #4247: Redirect _l function to non-locale version

Posted by GitBox <gi...@apache.org>.
gustavonihei merged pull request #4247:
URL: https://github.com/apache/incubator-nuttx/pull/4247


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] gustavonihei commented on a change in pull request #4247: Redirect _l function to non-locale version

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #4247:
URL: https://github.com/apache/incubator-nuttx/pull/4247#discussion_r679418734



##########
File path: libs/libc/string/lib_strncasecmp.c
##########
@@ -50,4 +50,9 @@ int strncasecmp(const char *cs, const char *ct, size_t nb)
 
   return result;
 }
+
+int strncasecmp_l(const char *cs, const char *ct, size_t nb, locale_t l)

Review comment:
       ```suggestion
   int strncasecmp_l(FAR const char *cs, FAR const char *ct, size_t nb, locale_t l)
   ```
   Also missing FAR qualifier




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] gustavonihei commented on pull request #4247: Redirect _l function to non-locale version

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on pull request #4247:
URL: https://github.com/apache/incubator-nuttx/pull/4247#issuecomment-888654377


   LGTM, but CI is failing on the **libc++** build.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #4247: Redirect _l function to non-locale version

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #4247:
URL: https://github.com/apache/incubator-nuttx/pull/4247#discussion_r679441262



##########
File path: libs/libc/string/lib_strncasecmp.c
##########
@@ -50,4 +50,9 @@ int strncasecmp(const char *cs, const char *ct, size_t nb)
 
   return result;
 }
+
+int strncasecmp_l(FAR const char *cs, FAR const char *ct, size_t nb, locale_t l)

Review comment:
       Done.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] gustavonihei commented on pull request #4247: Redirect _l function to non-locale version

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on pull request #4247:
URL: https://github.com/apache/incubator-nuttx/pull/4247#issuecomment-889868148


   @xiaoxiang781216 Will you submit this patch to LLVM project? If so, could you please post the link once you do it?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #4247: Redirect _l function to non-locale version

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #4247:
URL: https://github.com/apache/incubator-nuttx/pull/4247#discussion_r679441719



##########
File path: libs/libc/string/lib_strncasecmp.c
##########
@@ -50,4 +50,9 @@ int strncasecmp(const char *cs, const char *ct, size_t nb)
 
   return result;
 }
+
+int strncasecmp_l(const char *cs, const char *ct, size_t nb, locale_t l)

Review comment:
       Done.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on pull request #4247: Redirect _l function to non-locale version

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on pull request #4247:
URL: https://github.com/apache/incubator-nuttx/pull/4247#issuecomment-889889446


   Yes, I will prepare the patch to llvm.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on pull request #4247: Redirect _l function to non-locale version

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on pull request #4247:
URL: https://github.com/apache/incubator-nuttx/pull/4247#issuecomment-888898777


   > LGTM, but CI is failing on the **libc++** build.
   
   It's due to the macro expansion don't understand C++ namespace, so I change all macros to functions. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] gustavonihei commented on a change in pull request #4247: Redirect _l function to non-locale version

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #4247:
URL: https://github.com/apache/incubator-nuttx/pull/4247#discussion_r679575115



##########
File path: include/wchar.h
##########
@@ -34,6 +34,7 @@
 
 #include <stdio.h>
 #include <stddef.h>
+#include <local.h>

Review comment:
       ```suggestion
   #include <locale.h>
   ```
   ```
   /github/workspace/sources/nuttx/include/wchar.h:37:10: fatal error: local.h: No such file or directory
      37 | #include <local.h>
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #4247: Redirect _l function to non-locale version

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #4247:
URL: https://github.com/apache/incubator-nuttx/pull/4247#discussion_r679393423



##########
File path: libs/libc/wchar/lib_wcsftime.c
##########
@@ -39,4 +39,10 @@ size_t wcsftime(FAR wchar_t *s, size_t maxsize, FAR const wchar_t *format,
 
   return strftime((FAR char *)s, maxsize, (FAR char *)format, tim_p);
 }
+
+size_t wcsftime_l(FAR wchar_t *s, size_t maxsize, FAR const wchar_t *format,
+                 FAR const struct tm *tim_p, locale_t l)

Review comment:
       Done.

##########
File path: libs/libc/string/lib_strcoll.c
##########
@@ -56,4 +56,9 @@ int strcoll(const char *a, const char *b)
 {
   return strcmp(a, b);
 }
+
+int strcoll_l(const char *a, const char *b, locale_t l)

Review comment:
       Done.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org