Changeset 110035 in webkit


Ignore:
Timestamp:
Mar 7, 2012 1:24:07 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[EFL] Build warning: Fix warn_unused_result warnings.
https://bugs.webkit.org/show_bug.cgi?id=79194

Patch by Byungwoo Lee <bw80.lee@samsung.com> on 2012-03-07
Reviewed by Filip Pizlo.

Fixed build warning which is getting generated when not using return
value of a fuction, especially declared with warn_unused_result
attribute.

Source/WebCore:

  • platform/efl/SharedBufferEfl.cpp:

(WebCore::SharedBuffer::createWithContentsOfFile):

Tools:

  • DumpRenderTree/efl/ImageDiff.cpp:

(printImage):

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r110034 r110035  
     12012-03-07  Byungwoo Lee  <bw80.lee@samsung.com>
     2
     3        [EFL] Build warning: Fix warn_unused_result warnings.
     4        https://bugs.webkit.org/show_bug.cgi?id=79194
     5
     6        Reviewed by Filip Pizlo.
     7
     8        Fixed build warning which is getting generated when not using return
     9        value of a fuction, especially declared with warn_unused_result
     10        attribute.
     11
     12        * platform/efl/SharedBufferEfl.cpp:
     13        (WebCore::SharedBuffer::createWithContentsOfFile):
     14
    1152012-03-07  Kent Tamura  <tkent@chromium.org>
    216
  • trunk/Source/WebCore/platform/efl/SharedBufferEfl.cpp

    r95901 r110035  
    6262    }
    6363
    64     fread(result->m_buffer.data(), 1, fileStat.st_size, file);
     64    const size_t bytesRead = fread(result->m_buffer.data(), 1, fileStat.st_size, file);
    6565    fclose(file);
    6666
    67     return result.release();
     67    return bytesRead == static_cast<unsigned>(fileStat.st_size) ? result.release() : 0;
    6868}
    6969
  • trunk/Tools/ChangeLog

    r110032 r110035  
     12012-03-07  Byungwoo Lee  <bw80.lee@samsung.com>
     2
     3        [EFL] Build warning: Fix warn_unused_result warnings.
     4        https://bugs.webkit.org/show_bug.cgi?id=79194
     5
     6        Reviewed by Filip Pizlo.
     7
     8        Fixed build warning which is getting generated when not using return
     9        value of a fuction, especially declared with warn_unused_result
     10        attribute.
     11
     12        * DumpRenderTree/efl/ImageDiff.cpp:
     13        (printImage):
     14
    1152012-03-07  Kangil Han  <kangil.han@samsung.com>
    216
  • trunk/Tools/DumpRenderTree/efl/ImageDiff.cpp

    r96724 r110035  
    210210            unsigned char buffer[2048];
    211211            ssize_t bytesRead;
    212             while ((bytesRead = read(tempImageFd, buffer, sizeof(buffer))) > 0)
    213                 write(1, buffer, bytesRead);
     212            while ((bytesRead = read(tempImageFd, buffer, sizeof(buffer))) > 0) {
     213                ssize_t bytesWritten = 0;
     214                ssize_t count;
     215                do {
     216                    if ((count = write(1, buffer + bytesWritten, bytesRead - bytesWritten)) <= 0)
     217                        break;
     218                    bytesWritten += count;
     219                } while (bytesWritten < bytesRead);
     220            }
    214221        }
    215222    }
Note: See TracChangeset for help on using the changeset viewer.