Ad
  • Default User Avatar

    Too easy for 6 kyu.

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    There are warnings in sample test from C compiler:

    fixture.c:104:14: warning: passing 'char []' to parameter of type 'unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign]
      imageTest (codewars_rgb,
                 ^~~~~~~~~~~~
    fixture.c:18:32: note: passing argument to parameter 'imageData' here
    void imageTest (unsigned char *imageData, int h, int w, void* weights, int n, const unsigned char *expected) {
                                   ^
    fixture.c:107:14: warning: passing 'char []' to parameter of type 'const unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign]
                 codewars_laplacianFiltered);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
    fixture.c:18:100: note: passing argument to parameter 'expected' here
    void imageTest (unsigned char *imageData, int h, int w, void* weights, int n, const unsigned char *expected) {
                                                                                                       ^
    2 warnings generated.
    

    It may be fixed by explicit conversion to (unsigned char *):

      imageTest ((unsigned char *)codewars_rgb,
                 codewars_height, codewars_width,
                 kernel_laplacianFilter, 9,
                 (unsigned char *)codewars_laplacianFiltered);
    
  • Default User Avatar

    Seems too easy for 5 kyu.