Re: Visual Studio Code recommended extensions

2017-02-24 Thread James Cheng
Hi,
Is it possible to configure  VSCode to make "watch window" show "value"
with *"type" *information especially for strong typed language C++?


Cheers,
James


2017-02-24 0:48 GMT+08:00 Marco Bonardo :

> Hi,
> I recently started testing VS Code as a replacement for Sublime Text or
> Atom, and so far the experience has been better than I was expecting. I
> suspect others of you are doing the same.
>
> In bug 1341585, I'm adding .vscode/settings.json to the ignore lists, so
> that everyone can create his own workspace settings file.
>
> Additionally, I'd like to provide an extensions.json that contains a list
> of extensions "recommended" to newcomers. The purpose is to help new
> contributors setting up their editor if they'd ever decide to use VS Code.
> These extensions are suggested the first time the worskspace (src root dir)
> is opened, and can be reached at any time through the Show Recommended
> Extensions for this Workspace menu. they are only suggested, not installed
> by default.
>
> I'd like you to help me figuring out this list of extensions. Please
> provide feedback about the ones I picked, and suggest others that you are
> using for your everyday work.
>
> My current list:
> // Trim only touched lines.
> "NathanRidley.autotrim",
>
> // Hilight trailing whitespaces.
> "ybaumes.highlight-trailing-white-spaces",
>
> // JS Babel ES6/ES7 syntax hilight.
> "dzannotti.vscode-babel-coloring",
> "dzannotti.theme-spacemacs",
>
> // ESLint support.
> "dbaeumer.vscode-eslint",
>
> // C/C++ language support.
> "ms-vscode.cpptools",
>
> // Rust language support.
> "saviorisdead.RustyCode"
>
> Thank you
> ___
> dev-platform mailing list
> dev-platform@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-platform
>
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: Converting const char (&name)[N] to nsACString

2017-07-05 Thread James Cheng
Why do you need a copy?

Could you just cast the name to char*?
2017年7月5日 下午5:45,"nmago" 寫道:

Thank you, Honza Bambas and smaug!

Found solution:

char* cname = new char[N];
memcpy(cname, &name, N);
nsACString strName(cname, N, 0);
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: refcounting - which types to use ?

2017-08-24 Thread James Cheng
How could I make it compile error?

I did write

RefPtr xxx = yyy;
xxx.forget();

It is ok for compiling on my Mac.

The comment [1] said " Makes it a compile time error to not use the return
value of a function which has this type", but how do I make the clang
format take effect?

BTW, if you want to ignore the return value, you can use the special
version of Unused [2], but it will leak if you don't manually delete the
pointer.
[1]
http://searchfox.org/mozilla-central/rev/48ea452803907f2575d81021e8678634e8067fc2/mfbt/Attributes.h#519-521
[2]
http://searchfox.org/mozilla-central/rev/48ea452803907f2575d81021e8678634e8067fc2/mfbt/AlreadyAddRefed.h#112-117

2017-08-24 17:31 GMT+08:00 :

> On Thursday, August 17, 2017 at 1:02:56 PM UTC+2, Aryeh Gregor wrote:
> > Note that in this case you cannot ignore the return value -- it must
> > be assigned to an nsCOMPtr or a RefPtr, or else it will leak.  Ideally
> > we would allow a return type of nsCOMPtr&&, but
> > currently I think we don't.
>
> This is not entirely correct.
>
> alreadyAddRefed is marked MOZ_MUST_USE_TYPE.
>
> If you do not use the return value, it will not compile.
> ___
> dev-platform mailing list
> dev-platform@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-platform
>
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: Firefox build issues with Rust and the new VS2017 15.5 update

2017-12-07 Thread James Cheng
Hi Ryan,

I did ``./mach bootstrap`` and the problem still happened with my  VS 15.5
update.

I deleted the folders under my .mozbuild and do the bootstrap again but it
seems useless...

The errors are something like

 9:58.83
c:\gecko-dev\obj-x86_64-pc-mingw32\dist\include\gtest/gtest-printers.h(878):
error C4996: 'std::tr1': warning STL4002: The non-Standard std::tr1
namespace and TR1-only machinery are deprecated and will be REMOVED. You
can define _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING to acknowledge that
you have received this warning.

and I did the bootstrap with the latest central(Bug 1423307 included).

Can I do anything for troubleshooting?

Thank you.

1. Firefox for Desktop Artifact Mode
2. Firefox for Desktop
3. Firefox for Android Artifact Mode
4. Firefox for Android
Your choice: 2
Running pip to ensure Mercurial is up-to-date...
Requirement already up-to-date: Mercurial in
c:\mozilla-build\python\lib\site-packages
Your version of Python (2.7.14) is new enough.
Your version of Rust (1.22.1) is new enough.
Rust supports i686-pc-windows-msvc, x86_64-pc-windows-msvc targets.
 0:23.30 Downloading clang.tar.bz2
 0:23.30 Downloading to temporary location
c:\Users\jameswc\.mozbuild\toolchains\1e9883794cf0be12-clang.tar.bz2
 0:23.77 Downloading... 0.0 %
 0:24.38 Downloading... 5.0 %
 0:25.14 Downloading... 10.0 %
 0:25.72 Downloading... 15.0 %
 0:26.31 Downloading... 20.0 %
 0:26.90 Downloading... 25.0 %
 0:27.52 Downloading... 30.0 %
 0:28.11 Downloading... 35.0 %
 0:28.70 Downloading... 40.0 %
 0:29.56 Downloading... 45.0 %
 0:30.24 Downloading... 50.0 %
 0:30.85 Downloading... 55.0 %
 0:31.44 Downloading... 60.0 %
 0:32.01 Downloading... 65.0 %
 0:32.57 Downloading... 70.0 %
 0:33.14 Downloading... 75.0 %
 0:33.67 Downloading... 80.0 %
 0:34.32 Downloading... 85.0 %
 0:34.95 Downloading... 90.0 %
 0:35.46 Downloading... 95.0 %
 0:36.11 Downloading... 100.0 %
 0:36.12 Downloaded artifact to
c:\Users\jameswc\.mozbuild\toolchains\1e9883794cf0be12-clang.tar.bz2
 0:36.47 untarring "c:\Users\jameswc\.mozbuild\clang.tar.bz2"

Your system should be ready to build Firefox for Desktop!



2017-12-07 23:00 GMT+08:00 Ryan VanderMeulen :

> Bug 1423307 has been merged to m-c now. After you've updated m-c, you can
> re-run |./mach bootstrap| to pick up the newer clang binaries that will fix
> the _Ty problem.
>
> -Ryan
>
> On Tue, Dec 5, 2017 at 2:14 PM, Ryan VanderMeulen <
> rvandermeu...@mozilla.com
> > wrote:
>
> > As a follow-up, it looks like updating to a newer LLVM version fixes the
> > problem. That update is being tracked in https://bugzilla.mozilla.org/
> > show_bug.cgi?id=1423307.
> >
> > For anybody already hitting this bustage locally, you can try updating
> > your clang toolchain under ~/.mozbuild/clang to the one below until the
> > in-tree changes are landed:
> > https://queue.taskcluster.net/v1/task/Q7sN0gfPSE-
> > OAEV5vuGtEA/runs/0/artifacts/public/build/clang.tar.bz2
> >
> > -Ryan
> >
> > On Tue, Dec 5, 2017 at 11:16 AM, Ryan VanderMeulen <
> > rvandermeu...@mozilla.com> wrote:
> >
> >> FYI, the VC++ 2017 v14.12 toolset included in the recently-released
> >> VS2017 15.5 update appears to have broken building Firefox due to issues
> >> with the Rust compiler (in particular, the version of libclang we ship
> with
> >> it) and one of the system headers:
> >>
> >> C:\PROGRA~2\MIB055~1\2017\COMMUN~1\VC\Tools\MSVC\1412~1.
> 258\include\type_traits:898:47:
> >> error: '_Ty' does not refer to a value
> >>
> >> Which in turns leads to a Rust panic and build failure.
> >>
> >> The Visual Studio installer allows you to install the prior v14.11
> >> toolset as well, but I haven't verified yet that our build system will
> >> properly use it if it's there. In the mean time, I'd strongly advise
> >> avoiding this update until it's sorted out.
> >>
> >> -Ryan
> >>
> >
> >
> ___
> dev-platform mailing list
> dev-platform@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-platform
>
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: Be more lenient with the NS_LITERAL_CSTRING macro

2016-08-12 Thread James Cheng
Once you defined

NS_LITERAL_CSTRING(s) as
static_cast(nsLiteralCString(s))

const char kSomeData[] = {5,5,6,6}; which is no a literal string  can be
passed to the constructor [1].

Non-null terminated data may cause some unexpected behavior.

[1]
https://dxr.mozilla.org/mozilla-central/source/xpcom/string/nsTLiteralString.h#32

2016-08-12 11:16 GMT+08:00 :

> For
> static constexpr auto& kSomeStrLiteral = "hello world";
> NS_LITERAL_CSTRING(kSomeStrLiteral) is not allowed.
>
> However, we can have
> auto s1 = nsLiteralCString("hello world");
> auto s2 = nsLiteralCString(kSomeStrLiteral);
>
> I wonder why didn't we define NS_LITERAL_CSTRING(s) as
> static_cast(nsLiteralCString(s))
> ?
> ___
> dev-platform mailing list
> dev-platform@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-platform
>
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: xulrunner 31, swt 4.5, ZOOM

2015-07-03 Thread James Cheng
昂鞥哦啊嗯嗯o鞥偶鞥/t身材一
2015年7月3日 下午3:30於 寫道:

> Hi,
>
> I have an SWT application that uses a browser to display HTML pages.
> Latest SWT 4.5 now support XulRunner v31, but something has changed: zoom
> is not working anymore. It was working before with SWT 4.4 and XulRunner
> v10.
>
> I have no experience with XulRunner or XUL. Did something changed between
> 10 and 31 regarding zoom?
>
> Here is what I used for zooming:
>
> var winWatcher = Components.classes["@
> mozilla.org/embedcomp/window-watcher;1
> "].getService(Components.interfaces.nsIWindowWatcher);
> var enumerator = winWatcher.getWindowEnumerator();
>
> var win = null;
> while (enumerator.hasMoreElements()) {
> var checkWin = enumerator.getNext();
> if (checkWin.document.location == '@{currentLocation}') {
> win = checkWin;
> break;
> }
> }
> if (win != null) {
> var interfaceRequestor =
> win.QueryInterface(Components.interfaces.nsIInterfaceRequestor);
> var webNavigation =
> interfaceRequestor.getInterface(Components.interfaces.nsIWebNavigation);
> var docShell =
> webNavigation.QueryInterface(Components.interfaces.nsIDocShell);
> var docViewer =
> docShell.contentViewer.QueryInterface(Components.interfaces.nsIMarkupDocumentViewer);
> docViewer.fullZoom = @{zoomLevel};
> }
> ___
> dev-platform mailing list
> dev-platform@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-platform
>
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform