Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
No newline at end of file
16-03-2012, 04:09 PM
Post: #1
No newline at end of file
I'm getting a few warnings when I compile ohNet using g++ 4.1.1:

Build/Include/OpenHome/Net/C/DvServerUpnp.h:55:31: warning: no newline at end of file
Build/Include/OpenHome/Net/Core/DvServerUpnp.h:52:30: warning: no newline at end of file
Build/Include/OpenHome/Net/Private/Bonjour.h:37:25: warning: no newline at end of file
Build/Include/OpenHome/Net/Private/EventUpnp.h:55:28: warning: no newline at end of file
Build/Include/OpenHome/Net/Private/MdnsProvider.h:29:30: warning: no newline at end of file
OpenHome/Net/Bindings/Java/CpDeviceListCallback.h:7:88: warning: no newline at end of file

Would it be possible to fix these, please?

Simon
Find all posts by this user
16-03-2012, 05:11 PM
Post: #2
RE: No newline at end of file
No problem. I'll do these (plus any others) at the start of next week.
Find all posts by this user
16-03-2012, 05:12 PM
Post: #3
RE: No newline at end of file
I found a few more:

OpenHome/Net/Bindings/Java/JniCallbackList.h:41:33: warning: no newline at end of file
OpenHome/Net/Bindings/Java/JniCallbackList.c:47:2: warning: no newline at end of file
OpenHome/Net/Bindings/Java/NetworkAdapter.c:77:7: warning: no newline at end of file
OpenHome/Net/Bindings/Java/PropertyCallback.h:5:84: warning: no newline at end of file
Find all posts by this user
16-03-2012, 05:39 PM
Post: #4
RE: No newline at end of file
Now fixed (locally at any rate).

In case its helpful in future, I used the following bit of python to list the files. If it hadn't found a fairly short list, I'd also have made the script add the trailing newline.

Code:
import os
import string

def checkDir(arg, dirname, files):
    for file in files:
        filepath = os.path.join(dirname, file)
        if not os.path.isdir(filepath):
            ext = os.path.splitext(os.path.join(dirname, file))[1]
            if ext in ['.cpp', '.h', '.c', '.tt', '.cs']:
                fh = open(os.path.join(dirname, file), 'rb')
                data = fh.read()
                fh.close()
                if not data.endswith("\n"):
                    print filepath

os.path.walk('c:/work/ohnet/OpenHome', checkDir, '')
Find all posts by this user


Forum Jump: